Webdriver Chrome Selenium

Asked

Viewed 182 times

0

I have the following code:

System.setProperty("webdriver.chrome.driver", "C:\\libjava\\chromedriver2.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
WebDriver driver = new ChromeDriver(options); // <<< LINHA DO ERRO

Returning the error below:

Exception in thread "main" java.lang.AbstractMethodError: org.openqa.selenium.chrome.ChromeOptions.is(Ljava/lang/String;)Z
    at org.openqa.selenium.remote.RemoteWebDriver.init(RemoteWebDriver.java:170)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:123)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
    at webscrapping.WebScrapping.main(WebScrapping.java:36)

Someone could help?

  • what version of Selenium? this exception indicates that he is trying to call an abstract method, apparently that of options there

  • I have in the libraries the Selenium-api-3.8.1.jar and also the Selenium-server-standalone-3.141.59.jar

1 answer

0

can try the following:

ChromeOptions options = new ChromeOptions();
        options.setHeadless(true);
        System.setProperty("webdriver.chrome.driver", "C:\\libjava\\chromedriver2.exe");
       WebDriver driver = new ChromeDriver(options);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.