5
votes

Upgraded to Selenium 3.7 recently and ran into error.

Error trace log:

Debug 1 Debug 2 Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 2198 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z' System info: host: 'Maggies-MacBook-Pro-2.local', ip: '192.168.1.6', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192) 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:600) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at AutomationFrameWork.FirstTestCase.main(FirstTestCase.java:13) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:2198/status] to be available after 20005 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187) ... 9 more Caused by: java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:205) at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:147) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75) ... 10 more

Code:

public static void main (String args[]){
    System.out.println("Debug 1");
    System.setProperty("webdriver.chrome.driver", "/Users/maggie/Documents/ToolsQA/Libs/chromedriver"); 
    System.out.println("Debug 2");
    WebDriver driver = new ChromeDriver();
    System.out.println("Debug 3");
    driver.get("http://www.google.com");
    driver.quit();
}

Included Libraries: selenium-server-standalone-3.7.1.jar

System Environment:

Mac OS: '10.12.6'

java.version: '1.8.0_121'

selenium-server-standalone-3.7.1.jar

geckodriver - v0.19.1

ChromeDriver 2.33

Chrome Version 62.0.3202.89 (64-bit)

Thank you for any thought.

5
In most such cases your specific driver version doesn't work with the specific browser version. Try different versions of both, also read what the devs say about support. It could also get more complicated for different systems like your Mac. On my Raspberry Pi for example I searched nearly 2 hours for driver-browser version pair that worked.Zabuzard

5 Answers

3
votes

I had the same issue, on Mac OS. Check your /etc/hosts file and make sure you have 127.0.0.1 binding to localhost. I was missing that, added it and voila!

0
votes

As you are seeing WebDriverException: Timed out waiting for driver server to start. try the below mentioned steps :

  • Uninstall Google Chrome through Revo Uninstaller.

  • Install the latest version of Google Chrome.

  • Perform some steps on the website so you are sure that the website opens properly.

  • If needed induce Explicit Wait i.e. WebDriverWait

0
votes

Change this

System.setProperty("webdriver.chrome.driver", "/Users/maggie/Documents/ToolsQA/Libs/chromedriver" to "/Users/maggie/Documents/ToolsQA/Libs/chromedriver.exe" and try this

0
votes

I faced same issue with ChromeDriver 74.0.3729.6, chrome browser 74 and selenium-java-3.141.59 Changed the selenium java libs to version selenium-java-3.13.0 it worked

0
votes

I faced similar issues. Problem was with my ChromeDriver, I downloaded latest stable version and it worked.

Link for ChromeDriver : https://sites.google.com/a/chromium.org/chromedriver/