Selenium: Not able to create WebDriver due to NoSuchMethodError from org.openqa.selenium.net.UrlChecker.<init>(UrlChecker.java:62)

Created on 15 Dec 2017  路  4Comments  路  Source: SeleniumHQ/selenium

Meta -

OS:
Windows 10

Selenium Version:
selenium-java-3.8.1

Browser:
Chrome, Firefox, Edge

Browser Version:
ChromeDriver (2.34), Firefox (gecko 0.19.1), Edge (release 16299)

Expected Behavior -

Able to create a default ChromeDriver.

Actual Behavior -

Compile error NoSuchMethodError from org.openqa.selenium.net.UrlChecker.(UrlChecker.java:62) when attempting to create a default ChromeDriver.

I have attempted to create other Drivers such as Firefox(GeckoDriver) and Edge and I receive the same result on Edge and a similar results of Firefox

Java JDK version I am using is: jdk1.8.0_151

Stack Trace:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/SimpleTimeLimiter;
    at org.openqa.selenium.net.UrlChecker.<init>(UrlChecker.java:62)
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    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:123)
    at browser_mob_proxy_test.Selenium8_1Test.main(Selenium8_1Test.java:13)

Steps to reproduce -

public static void main(String[] args) 
    {
        // Set location of chrome webdriver
        System.setProperty("webdriver.chrome.driver", "Webdrivers/chromedriver.exe");

        ChromeDriver driver = new ChromeDriver();

        driver.manage().window().maximize();

        driver.get("https://www.google.com/");

        try
        {
            Thread.sleep(3000);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }

        driver.close();

        return;
    }

Most helpful comment

Update guava dependency to at least version 22

All 4 comments

Update guava dependency to at least version 22

The Guava version for selenium java version 3.8.1 is packaged with guava version 23.0. I found out the reason why I was running into compile issues, however; it doesn't involve Selenium itself but another package.

For all those who want to know what the source of the issue was;
I was using BrowserMobProxy (BMP) jars along with Selenium Jars to run my program. The compile issue I ran into began after I updated my Selenium jars and then tried to compile my program. After many fun hours of updating the remainder of my dependencies, with no luck of a fix, I thought it would be worth the shot to remove my BMP jars from my dependencies list and re-compile the program. Fortunately, the program compiled successfully; it ran too. After the program compiled and ran, I re-added the BMP dependencies and re-compiled the program and it compiled successfully this time.

While the above is an annoying fix for my issue, I was able to replicate the issue on this github issue on multiple computers. I also went through the same steps that I have listed above in my comment and that resolved the compile issue on all the computers that I was able to replicate the issue on.

Yes, @johnchris93 :+1: +1:
I also had the same problem. Thank you so much for your comment on this issue.
This issue has been resolved now :-)

i mean i have same issues like 2 days.. my guava and selenium are latest version dependencies...
Any thoughts?

Was this page helpful?
0 / 5 - 0 ratings