Selenium Chromedriver server times out despite being available - java

I have a Java Selenium project that will not run on my machine, but does run on coworkers' machines with the same OS version (OSX 10.13.1), Chrome browser version (63.0.3239.84), and chromedriver version (2.34). I get the message:
Starting ChromeDriver 2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e) on port 18633
Only local connections are allowed.
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T18:33:54.468Z'
System info: host: 'localhost', ip: 'fe80:0:0:0:1cc9:e0ab:f4e5:dd34%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.1', java.version: '1.8.0_20'
Driver info: driver.version: ChromeDriver
...
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:18633/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)
... 28 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:149)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
... 29 more
however when I open http://localhost:18633/status in my browser I get a valid response:
{"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.13.1"}}}
I've tried swapping out chromedriver binaries, but I'm not really sure what else to do. I get similar issues with geckodriver, but that may or may not be the same issue.
I have also tried creating a new user on my system and running it from that account, to account for user settings - No luck.
What am I missing here? What info would be helpful to debug this problem?

The error says it all :
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Clearly indicates the WebDriver instance didn't get initiated. Hence Driver info is left blank as :
Driver info: driver.version: ChromeDriver
Which inturn produces the error:
org.openqa.selenium.net.UrlChecker$TimeoutException
and
java.util.concurrent.TimeoutException
It would be tough to guess the actual reason without any visibility of your code block but in general we can solve this by downloading the ChromeDriver binary from this repository and passing the absolute path of the ChromeDriver while initializing the WebDriver instance as follows :
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
driver = new ChromeDriver();
Key Points :
Always use the latest version of the Selenium Client and ChromeDriver binaries.
Always keep the automatic updates for the browser enabled.
Always keep the JDK version updated (the current version being JDK 8u241)

Related

org.openqa.selenium.SessionNotCreatedException: Message: Could not start a new session. Response code 500 error using Selenium Java

A window appears after launch and immediately disappears, I can not understand what's wrong. Google except for the latest version, selenium is also set to the LATEST parameter (nothing changes with a specific version).
Error:
org.openqa.selenium.SessionNotCreatedException: Message: Could not start a new session. Response code 500. Message: session not created
Code:
Error:
Update your chromedriver version, it seems your your browser and browser current driver version aren't same.
https://chromedriver.storage.googleapis.com/index.html?
This error message...
org.openqa.selenium.SessionNotCreatedException: Message: Could not start a new session. Response code 500. Message: session not created:
.
Driver info: org.openqa.selenium.chrome.ChromeDriver
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chrome=99.0
Release Notes of ChromeDriver v99.0 clearly mentions the following :
Supports Chrome version 99
But your chromedriver version is not getting detected.
Driver info: org.openqa.selenium.chrome.ChromeDriver
Your JDK version 1.8.0_281 is also old and ancient.
So most possibly there is a mismatch between jdk version, chromedriver version and the chrome=99.0
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u311.
ChromeDriver is updated to current ChromeDriver v99.0 level.
Chrome Browser is updated to current chrome=99.0 (as per chromedriver=99.0.4844.51 release notes).
If some one is on linux,
some distros install /usr/bin/google-chrome-stable, web driver manager tries to retry the version of chrome with the command
/usr/bin/google-chrome --version
Since that bin does not exists, is going to fail; The solution is very simple
just a simbolic link to google-chrome
# ln -s /usr/bin/google-chrome-stable /usr/bin/google-chrome
More than an answer this continues with the question.
I'm using serenity-bdd with the following characteristics:
Ubuntu: 22.04.1
Google-Chrome: 106.0.5249.103
Chrome driver: 106.0.5249.61
And the generated message error is:
<<< ERROR!
net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.chrome.ChromeDriver
Caused by: net.thucydides.core.webdriver.DriverConfigurationError:
Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Was trying with different driver combinations and none of them are working. Funny enough when i run on windows with the same configuration all works.
Starting ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414#{#1172}) on port 48484
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Failed to create Chrome process.
Host info: host: 'A-LAPTOP', ip: '192..0.'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.5'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:535)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:228)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:156)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:82)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:50)
at com.project.skyfall.Browser_Drivers.main(Browser_Drivers.java:13)
In short, you need to install the previous version of the web driver with such a problem

org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start with Selenium and Java

I have tried everything that has been told in Stackoverflow topics. I have java selenium tests run on remote slave through jenkins. The absurd thing is first test always run and browsers opens, all other tests give me "Timed out waiting for driver server to start".
public WebDriver startChrome() {
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("--aggressive-cache-discard");
chromeOptions.addArguments("--disable-cache");
chromeOptions.addArguments("--disable-application-cache");
chromeOptions.addArguments("--disable-offline-load-stale-cache");
chromeOptions.addArguments("--disk-cache-size=0");
chromeOptions.addArguments("--dns-prefetch-disable");
chromeOptions.addArguments("--no-proxy-server");
chromeOptions.addArguments("--log-level=3");
chromeOptions.addArguments("--silent");
chromeOptions.addArguments("--disable-browser-side-navigation");
chromeOptions.setPageLoadStrategy(PageLoadStrategy.NORMAL);
chromeOptions.addArguments("-disable-cache");
chromeOptions.addArguments("-disable-extensions");
chromeOptions.addArguments("--incognito");
chromeOptions.addArguments("start-maximized");
//chromeOptions.setExperimentalOption("useAutomationExtension", false);
ChromeDriverService chromeDriverService = ChromeDriverService.createDefaultService();
port = chromeDriverService.getUrl().getPort();
return new ChromeDriver(chromeDriverService, chromeOptions);
}
Error:
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-7', revision: 'de8579b6d5'
System info: host: 'ISTDTSTYNMD04V', ip: '10.52.253.54', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:231)
at org.openqa.selenium.remote.service.DriverService.lambda$start$0(DriverService.java:193)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1596)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:35592/status] to be available after 20000 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:90)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:227)
... 7 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:88)
... 8 more
All the solutions I have tried so far:
Update Java 1_8_271
Update Selenium 4
Update ChromeDriver 87
Check localhost traffic with rawcap
Check localhost dns definiton in etc/hosts
Update Chrome 87
Set Proxy
Check port availability
Check driver path
Kill all chrome and driver tasks before create (Only solution that worked, but not good for parallel tests)
Check localhost url and port is accessible with chrome -> http 200
When I try to reach url and port through java urlconnection in code driver create function catch block), it gives me connection reset but in chrome it gives 200.
All help will be appreciated.
Best Regards
This error message...
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-7', revision: 'de8579b6d5'
System info: host: 'ISTDTSTYNMD04V', ip: '10.52.253.54', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: unknown
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
A bit of more information about your usecase would have helped us to analyze the error in a better way. However to start with you can use only one single arguments start-maximized and remove all the other arguments which would get you started. So your effective code block will be:
public WebDriver startChrome() {
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("start-maximized");
ChromeDriverService chromeDriverService = ChromeDriverService.createDefaultService();
return new ChromeDriver(chromeDriverService, chromeOptions);
}
Additional Consideration
Ensure that:
JDK is upgraded to current levels JDK 8u271.
Selenium is upgraded to current released Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v87.0 level.
Chrome is updated to current Chrome Version 87.0 level. (as per ChromeDriver v87.0 release notes).
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
References
You can find a couple of relevant detailed discussions in:
Selenium Chromedriver server times out despite being available
Driver info: driver.version: unknown with ChromeDriver Chrome using Selenium and Python
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start while initiating Chrome browser through Selenium

Selenium UnreachableBrowserException - Java

System.setProperty("webdriver.chrome.driver","D:/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.navigate().to("https://link");
driver.findElement(By.cssSelector("#username")).sendKeys("id");
driver.findElement(By.cssSelector("#password")).sendKeys("pass");
driver.findElement(By.cssSelector("#clientName")).sendKeys("name");
driver.findElement(By.cssSelector("#submitButton")).click();
System.out.println("Okay !");
I set property for Chrome Driver. When I run it gives an error. (Below) I searched a lot but didn't found any solution.
Starting ChromeDriver 2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab) on port 10589
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:03.216Z'
System info: host: 'DESKTOP-9HVORCR', ip: '192.168.1.24', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:564)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
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 zaaa.main.main(main.java:11)
Caused by: java.lang.IllegalArgumentException: Unexpected char 0x131 at 23 in User-Agent value: selenium/3.12.0 (java wındows)
at okhttp3.Headers$Builder.checkNameAndValue(Headers.java:338)
at okhttp3.Headers$Builder.add(Headers.java:288)
at okhttp3.Request$Builder.addHeader(Request.java:177)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:85)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
... 6 more
I have tried these:
32/64 bit drivers.
Run it as administrator.
Creating a Try/Catch block.
Other drivers. (Like Operadriver.exe) (Result: Same error)
I think your windows is not english. I am having the same problem. When I tried the same in an english version windows 10 the code works without any problem.
Locale.setDefault(new Locale("en", "EN"));
you can also try this. it worked for me.
Add these lines before instantiating "WebDriver driver = new ChromeDriver();"
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--no-sandbox");
Then add the argument where you have declared Webdriver as shown below:-
WebDriver driver = new ChromeDriver(chromeOptions);
I hope it will help you.
Here you are using
selenium version : 3.12.0
chromedriver version : 2.40
When i tried to run with these configurations (they are latest at present)
I am able to launch the application without any exception and in the logs getting :
Starting ChromeDriver 2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab) on port 35584
Only local connections are allowed.
Jun 21, 2018 2:42:51 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Okay !
which is same as your starting logs.
My chrome browser version is :
Version 67.0.3396.87 (Official Build) (64-bit)
I think you should check your .m2 folder and delete
.m2\repository\org\seleniumhq\selenium
folder from there and then again try to download the dependencies.
Also update to latest chrome browser version.
Hope it helps.
This is a problem of Turkish Windows. As it is indicated in exception message the 'ı' character in user agent value "selenium/3.12.0 (java wındows)" is the cause of the exception.
The problem is the string "WINDOWS" is changed to lower case and it results "wındows" because of TR locale. I found that it is generated in class org.openqa.selenium.remote.http.HttpClientand added Locale.US like this.
String USER_AGENT = String.format(
"selenium/%s (java %s)",
new BuildInfo().getReleaseLabel(),
(Platform.getCurrent().family() == null ?
Platform.getCurrent().toString().toLowerCase(Locale.US) :
Platform.getCurrent().family().toString().toLowerCase(Locale.US)));
I compiled the library with my changes and it works now. I also opened a pull request on github.
You can also find my edited fork here.

Invalid port. Exiting...org.openqa.selenium.os.OsProcess checkForError using ChromeDriver and Chrome through Selenium

Source code:
package Labarary;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class LAb {
public static void main(String[] args) {
System.out.println("chrome");
System.setProperty("webdriver.chrome.driver","C:\\Users\\Manjit\\Downloads\\chromedriver_win32\\chromedriver.exe");
// TODO Auto-generated method stub
WebDriver driver=new ChromeDriver();
}
}
Invalid port. Exiting...
??? ??, ???? ??:??:?? ???????
org.openqa.selenium.os.OsProcess checkForError SEVERE:
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1 (Exit value: 1) Exception in thread "main"
org.openqa.selenium.WebDriverException: Timed out waiting for driver
server to start. Build info: version: '3.12.0', revision: '7c6e0b3',
time: '2018-05-08T15:15:03.216Z' System info: host: 'MANJIT-PC', ip:
'192.168.1.19', os.name: 'Windows 7', os.arch: 'amd64', os.version:
'6.1', java.version: '1.8.0_171' 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:543)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:130)
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 Labarary.LAb.main(LAb.java:20) Caused by:
org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting
for [http://localhost:?????/status] to be available after ????? 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(Unknown Source) at
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:148)
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
... 10 more
This error message...
Invalid port. Exiting... ??? ??, ???? ??:??:?? ???????
org.openqa.selenium.os.OsProcess checkForError
...implies that the OsProcess is unable to bind the ChromeDriver server process to the assigned free port within your system.
As per the discussion Getting Invalid port error and Invalid port. Exiting...
"Invalid port. Exiting..." occurs when the port assigned to chromedriver is less than 0 or greater than 65535.
Debugging steps
Perform the following steps to address the core issue:
Execute netstat command through CLI to see if you have reached limit of possible open connections or check if there is another application running on the port used by ChromeDriver.
Check your firewall settings, there is a good chance that firewall configuration may be blocking the communication.
Upgrade ChromeDriver to current ChromeDriver v2.84 level.
Upgrade Chrome to current Chrome v84.0 levels. (as per ChromeDriver v84.0 release notes)
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
(WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
(LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
Take a System Reboot to free up the used ports.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Alternative
As an alternative you can force the WebDriver variant i.e. ChromeDriver to start on a specific port e.g. 65535 as follows:
Code Block:
System.setProperty("webdriver.chrome.driver","C:\\WebDrivers\\chromedriver.exe");
WebDriver driver= new ChromeDriver(new ChromeDriverService.Builder().usingPort(65535).build());
driver.get("https://www.google.com/");
Console Output:
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103#{#416}) on port 65535
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jul 20, 2020 7:36:17 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
References
You can find a couple of relevant detailed discussions in:
Invalid port. Exiting… org.openqa.selenium.os.OsProcess checkForError while launching chrome using selenium

org.openqa.selenium.WebDriverException: chrome not reachable - when attempting to start a new session

When I run my tests on Chrome I often get a WebdriverException that Chrome is not reachable. It doesn't happen every time. Maybe once every 15 times. I am having to run everything on Windows machines and I have the latest Chrome, Chromedriver, Selenium-Webdriver versions.
I've tried setting the environmental variable "DBUS_SESSION_BUS_ADDRESS=/dev/null". Doesn't help at all.
Anyone come across this and found a solution?
org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 62.52 seconds
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'CORPMNA7158A', ip: '10.26.195.163', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.chrome.ChromeDriver
The error does gives us some hint as follows :
org.openqa.selenium.WebDriverException: chrome not reachable
Which essentially implies that chromedriver binary is unable to spawn a new Chrome Browser process.
Your main issue is the version compatibility among the binaries you are using as follows :
You are using chromedriver=2.35.528161 (released 2018-01-10)
Release Notes of chromedriver=2.35 clearly mentions the following :
Supports Chrome v62-64
You mentioned of using latest Chrome. I suppose it is chrome=65.x
You are using Selenium Version 2.52.0 (released 2016-02-11 11:22:43) [as per the error stack trace within your question]
So the time gap between the release of Selenium Version 2.52.0 and chromedriver=2.35.528161 is almost 2 Years and are not compatible. Hence ChromeDriver is unable to spawn the new Chrome Browser process at times.
Solution
Keep the ChromeDriver at v2.35 level.
Downgrade Chrome to stable Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
Upgrade Selenium to current levels Version 3.8.1.
Execute your Test.

Categories