5

In our Selenium remote webdriver set up, we wrote our Selenium Java test scripts for to run in Chrome Browser. We are using Chrome Driver 2.28. Selenium Standalone Server 2.53. Selenium API 2.53. When we run our scripts from with in Eclipse IDE, 3 out of 5 times, the Chrome browser does not get invoked or take a long time to start by the script. When it fails to invoke the browser, it fails with this exception ....

> Caused by: org.openqa.selenium.WebDriverException: chrome not
> reachable   (Driver info: chromedriver=2.28.455520
> (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT
> 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 62.50 seconds
> Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15
> 17:00:58' System info: host: '<XXXXXXX>', ip: '<XXXXXXXXXX>',
> os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
> java.version: '1.8.0_121' Driver info:
> org.openqa.selenium.chrome.ChromeDriver
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>         at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
>         at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
>         at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
>         at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
>         at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
>         at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
>         at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
>         at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
>         ... 13 more 11:58:11.356 WARN - Exception: chrome not reachable

(Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 62.50 seconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' System info: host: '', ip: '', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:138) ... 13 more 11:58:11.356 WARN - Exception: chrome not reachable

The temporary but painful solution is to go to Windows TaskManager and kill the half a dozen or so, Chrome.exe processes one after another. It is observed that even when we run our script or manually running the application, the Chrome browser processes that get invoked are more like 6 or 7, not less.

Is it a Chrome Browser or Selenium issue. ? Individually, I used NOT to have this problem unlike my team member who is having this problem since a year. As soon as I upgraded Chrome Driver to 2.28 from 2.25, I started having this problem.

PraNuta
  • 629
  • 3
  • 12
  • 33

5 Answers5

5

If you are running the script as root user, it will throw the error "chrome not reachable". Try running script as normal user, it will work fine.

Rajat Chaudhary
  • 180
  • 1
  • 9
2

Try adding this before opening another instance.

driver.close();
driver.quit();
user4906240
  • 605
  • 1
  • 6
  • 20
0

Upgrade you selenium standalone jar to latest ones 3.3.1 from here http://www.seleniumhq.org/download/

Kushal Bhalaik
  • 3,349
  • 5
  • 23
  • 46
  • Thanks for the quick response. Is this a hunch or the issue you had faced and solved by this approach ? The reason I ask is our firm strictly controls everything that is being installed on our PCs. In fact they push it to our PCs after we request it on the company software catalogue. It is a tedious process to convince them to put it up in the software center and then downloading it. I need to give a solid argument. – PraNuta Apr 05 '17 at 20:55
  • Yup. That is the only reason I believe. – Kushal Bhalaik Apr 06 '17 at 03:35
  • We checked by upgrading to Selenium 3.3.1 Standalone Server plus Client Java API to 3.3.1 in our remote web driver setup, we got a different message this time which reads like "Session timed out". May be not as frequent as it was. Nevertheless it is not a successful solution. Waiting for great suggestions. – PraNuta Apr 12 '17 at 18:18
  • have you upgraded your chrome driver to 2.28? – Kushal Bhalaik Apr 13 '17 at 05:44
  • Yes. Sir !! Please remember that we are in a Remote Driver setup due to other reasons which we don't have control over. With out understanding much we are running a Selenium Standalone server on port 60000 and running scripts from Eclipse. – PraNuta Apr 13 '17 at 16:54
  • So if you ahve got chromedriver 2.28, java 8, selenium 3.3.1 and chrome 57; then all should work fine – Kushal Bhalaik Apr 13 '17 at 17:26
  • Dear Kushal: Ironically NO. It is not. 3 out of 5 times it is failing to launch the Chrome browser. Then we go to task manager. Forcefully kill all the chrom.exe, chromedriver.exe instances, then try again. Then also it happens but more possibility for chrome browser being launched. There was a very similar post on Stackoverflow web site at http://stackoverflow.com/questions/28364012/webdriver-exception-chrome-not-reachable and https://bugs.chromium.org/p/chromedriver/issues/detail?id=321 – PraNuta Apr 13 '17 at 18:47
  • @PraNuta : did you get a resolution for this issue? – Kushal Bhalaik Jun 25 '18 at 09:30
  • Thanks Kushal for your enquiry. I changed the job. I forgot about the whole thing. – PraNuta Jun 27 '18 at 02:45
  • @PraNuta : ohh.., No worries – Kushal Bhalaik Jun 28 '18 at 07:49
0

I faced this issue in my project. I resolved this by

  • upgrading Selenium Webdriver to latest version 3.3.1
  • upgrading Chrome Driver to version 2.28
  • Make your you have latest version of Chrome browser in your system. Make sure your browser is up to date

You can get all the browser drivers from Selenium Downloads

Thanks

Corey Goldberg
  • 59,062
  • 28
  • 129
  • 143
Thangakumar D
  • 714
  • 5
  • 12
  • 27
  • Firefox we will NOT be using for Selenium testing, as our entire user community is only using Chrome alone. That will not be a problem. But for using Chrome browser itself, we don't need to do any more than (1)upgrade WebDriver 3.3.1 (2)upgrade chrome driver 2.28 (3) keep your Chrome browser up to the latest. Is that all and correct?? – PraNuta Apr 06 '17 at 19:04
0

I had the same problem and had to add a path to the actual Chrome browser binary in the ChromeOptions and include the ChromeDriver in the Windows PATH. (edit: I am not running remote driver setup though)

dma
  • 89
  • 7