cannot find Chrome binary (I checked the PATH!)

8,727 views
Skip to first unread message

bre...@gmail.com

unread,
Sep 2, 2018, 11:30:50 AM9/2/18
to ChromeDriver Users
I'm trying to use ChromeDriver remotely. My code works when ChromeDriver is local, but breaks remotely and complains about not finding the ChromeDriver. My local dev instance is Windows 10 in which ChromeDriver is added to PATH. The remote instance is Ubuntu 10.04.1 LTS (bionic), and ChromeDriver has been added to both /usr/local/bin and /bin. On my local and remote server, ChromeDriver can be called from the commandline no problem.

Python code:

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

desired_capabilities = {}
desired_capabilities['chromeOptions'] = { "args" : ["--headless --hide-scrollbars --ignore-certificate-errors"] }

# this works fine
driver = webdriver.Remote("localhost:9515", desired_capabilities=desired_capabilities)

# this returns an error

driver = webdriver.Remote("192.168.9.130:9515", desired_capabilities=desired_capabilities)

Error:

>>> driver = webdriver.Remote("192.168.9.130:9515", desired_capabilities=desired_capabilities)
[2018-09-02 11:28:02] DEBUG POST 192.168.9.130:9515/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {}}, "desiredCapabilities": {"chromeOptions": {"args": ["--headless --hide-scrollbars --ignore-certificate-errors"]}}}
[2018-09-02 11:28:02] DEBUG Starting new HTTP connection (1): 192.168.9.130
[2018-09-02 11:28:02] DEBUG http://192.168.9.130:9515 "POST /session HTTP/1.1" 200 249
[2018-09-02 11:28:02] DEBUG Finished Request
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Users\brett\code\pxintelligence\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\brett\code\pxintelligence\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\brett\code\pxintelligence\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Users\brett\code\pxintelligence\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-29-generic x86_64)


Thank you in advance!

John Chen

unread,
Sep 4, 2018, 7:00:00 PM9/4/18
to bre...@gmail.com, ChromeDriver Users
ChromeDriver doesn't currently use PATH to look for Chrome. It looks for Chrome at some standard installation locations, and if it can't find Chrome at those locations, it returns an error. (This is expected to be fixed eventually. See https://crbug.com/chromedriver/2550.)

The most reliable way is to pass the location of Chrome binary using Options object.

--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brett Cunningham

unread,
Sep 4, 2018, 9:14:13 PM9/4/18
to john...@chromium.org, chromedri...@googlegroups.com
That worked. Thanks!
Reply all
Reply to author
Forward
0 new messages