Python Linux Selenium: Chrome Not Reachable

selenium.common.exceptions.WebDriverException: Message: chrome not reachable error while using find_element_by_id Selenium with ChromeDriver

The error says it all :

    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable

This error is observed in case of version compatibility between the binaries which an user uses but definitely this is not your case as you are :

  • Using chromedriver=2.36
  • Using chrome=65.0
  • Selenium version unknown

    Release Notes of chromedriver=2.36 clearly mentions :

    Supports Chrome v65-66

But, since the release of the latest Chromedriver 2.36 Selenium users had been facing issues with it. Here is one of the threads :

  • We released the latest Chromedriver 2.36

The root cause is related to the commit regarding :

  • Remove --disable-infobars

    So, a couple of possible solution will be to :

  • To use ChromeOptions Class to maximize the browser.

  • Remove the option disable-infobars
  • An example :

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options

    options = Options()
    options.add_argument("start-maximized")
    driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\path\to\chromedriver.exe')
    driver.get('https://www.google.co.in')
    print("Page Title is : %s" %driver.title)

If your issue still persists consider the following :

  • Upgrade Selenium Python Client to current levels Version 3.10.0.
  • Upgrade ChromeDriver to stable ChromeDriver v2.35 level.
  • Keep Chrome version at Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome.
  • Execute your Test.

chrome not reachable Selenium webDriverException

Try running screen, hitting enter and then entering the nohup-command

python linux selenium: chrome not reachable

Adding some chrome options helped!

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome = webdriver.Chrome('/usr/local/bin/chromedriver', chrome_options=chrome_options)

Python selenium WebDriverException: chrome not reachable while opening ChromeDriver

The error says it all :

WebDriverException: chrome not reachable
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.16299 x86_64)

Your main issue is the version compatibility between the binaries you are using as follows :

  • You are using chromedriver=2.35
  • Release Notes of chromedriver=2.35 clearly mentions the following :

Supports Chrome v62-64

  • You are using chrome=65.0
  • Release Notes of ChromeDriver v2.36 clearly mentions the following :

Supports Chrome v64-66

So there is a clear mismatch between the ChromeDriver version (v2.35) and the Chrome Browser version (v65.0)

Solution

  • Upgrade Selenium to current levels Version 3.11.0.
  • Upgrade ChromeDriver to current ChromeDriver v2.37 level.
  • Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.37 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

WebDriverException: Message: chrome not reachable after long time

Initially I had asked myself the same questions as @GregBurghardt had been asking in the comments till I analyzed the detailed error stack trace.

Yes, there is somehting amazing happening in those steps marked as #do thing that require hours. Hence, instaed of showing Chrome browser version as chrome=76.0, chrome=75.0 or chrome=74.0 it shows:

(Session info: chrome=192.168.0.0)

which is pretty much surprising.

It would be almost impossible to analyze the issue until and unless you update us why and how the Chrome version gets changed to such value.


Having said that, possibly your main issue is the incompatibility between the version of the binaries you are using.

  • You are using chromedriver=2.36
  • Release Notes of chromedriver=2.36 clearly mentions the following :

Supports Chrome v63-65

  • Presumably you are using the latest chrome= 76.0
  • Release Notes of ChromeDriver v76.0 clearly mentions the following :

Supports Chrome version 76

  • Your Selenium Client version is unknown to us.

So there is a clear mismatch between the ChromeDriver v2.36 and the Chrome Browser v76.0


Solution

Ensure that:

  • Selenium is upgraded to current levels Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v76.0 level.
  • Chrome is updated to current Chrome Version 76.0 level. (as per ChromeDriver v76.0 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • 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:

  • Python selenium WebDriverException: chrome not reachable while opening ChromeDriver
  • selenium.common.exceptions.WebDriverException: Message: chrome not reachable error while using find_element_by_id Selenium with ChromeDriver
  • org.openqa.selenium.WebDriverException: chrome not reachable - when attempting to start a new session

WebDriverException: Message: chrome not reachable When it was working a minute before

Can you please check if your chrome browser is compatible with your chrome browser?
Could be possible your chrome is autommatically updated and now your chrome browser is not compatible with chrome driver.

You can download chrome driver from here

python selenium: WebDriverException: Message: chrome not reachable

The error you are seeing gives us some hint as follows :

WebDriverException                        Traceback (most recent call last)
<ipython-input-36-6bcc3a6d3d05> in <module>()
----> 1 driver.get('https://google.com')

Here are some observations and remedies :

  • First of all, I would like you to look back at the exact absolute path of the ChromeDriver binary and my guess is instead of :

    /Users/Users/Downloads/chromedriver_win32/chromedriver

    It should have been :

    /Users/Downloads/chromedriver_win32/chromedriver
  • Moreover, a better way to pass the location of the ChromeDriver binary would be to pass the argument executable_path along as well, so the line would be :

    driver = webdriver.Chrome(executable_path=r'/Users/Users/Downloads/chromedriver_win32/chromedriver')
  • Finally, whenever you invoke get() method to open an URL try to pass the Fully Qualified Domain Name (FQDN) as follows :

    driver.get('https://www.google.co.in')


Related Topics



Leave a reply



Submit