Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chromedriver can't find Chromium #12505

Open
meteficha opened this issue Jan 20, 2016 · 1 comment

Comments

@meteficha
Copy link

commented Jan 20, 2016

I'm using NixOS 15.09.911.53286a8.

If you just install chromium and chromedriver, you'll get this:

On terminal A:
$ chromedriver --verbose
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 9515
Only local connections are allowed.

On terminal B:
$ curl -XPOST 'http://localhost:9515/session' --data '{"desiredCapabilities":{"browserName":"chrome"}}'
{"sessionId":"cc018e4c7202ae2368e706684fca1c4a","status":13,"value":{"message":"unknown error: cannot find Chrome binary\n  (Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 4.3.0 x86_64)"}}

On terminal A:
[1,263][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browserName": "chrome"
   }
}
[1,263][INFO]: RESPONSE InitSession unknown error: cannot find Chrome binary
[1,263][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1,263][DEBUG]: Log type 'browser' lost 0 entries on destruction

However, there's a way of making it work:

On terminal A:
$ sudo ln -s `which chromium-browser` /bin/chromium-browser
$ chromedriver  --verbose
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 9515
Only local connections are allowed.

On terminal B:
$ curl -XPOST 'http://localhost:9515/session' --data '{"desiredCapabilities":{"browserName":"chrome"}}'
{"sessionId":"14cdd10a5aa9ecfcb0122fee3420d235","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"userDataDir":"/tmp/.com.google.Chrome.t6towJ"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"platform":"Linux","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"version":"45.0.2454.93","webStorageEnabled":true}}

On terminal A:
[3,384][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browserName": "chrome"
   }
}
[3,384][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
...

It seems that chromedriver only ever tries to find chromium on certain predefined paths.

@jgeerds jgeerds added the 0.kind: bug label Jan 22, 2016

@Ericson2314

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-Using-a-Chrome-executable-in-a-non-standard-location mentions

ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");

Maybe this points to a different default we can patch than the OPs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.