selenium: [🐛 Bug]: unknown error: cannot find Chrome binary

What happened?

Hi! After driver update it can’t start the browser. Previous driver version 114.0.5735.90 works with no issue. Chrome version - 115.0.5790.98 Chromedriver version - 115.0.5790.98 Selenium Java 4.10.0

https://github.com/GoogleChromeLabs/chrome-for-testing/issues/26

How can we reproduce the issue?

Run any tests with Chrome 115.0.5790.98 and Chromedriver 115.0.5790.98

Relevant log output

Suppressed: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary 
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.4.1', java.version: '20.0.1'


### Operating System

macos

### Selenium version

4.10.0

### What are the browser(s) and version(s) where you see this issue?

Chrome 115.0.5790.98

### What are the browser driver(s) and version(s) where you see this issue?

115.0.5790.98

### Are you using Selenium Grid?

_No response_

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (9 by maintainers)

Commits related to this issue

Most upvoted comments

The following command will install chromedriver 114 with homebrew, which is working with chrome 115: brew install --cask https://raw.githubusercontent.com/Homebrew/homebrew-cask/3ae9f9127a7863a581b79a78a739fb8613442491/Casks/chromedriver.rb

As a workaround in Selenium (and macOS), you can specify the Chrome binary path as follows ChromeOptions options = new ChromeOptions(); options.setBinary(“/Applications/Google Chrome.app/Contents/MacOS/Google Chrome”); Thnx @bonigarcia

Selenium 4.11.0 has been released, please upgrade and this should work.

I also get the same. I don’t think its an Selenium issue, rather an Chromedriver issue. It works fine on Linux but on Mac the Chrome binary can’t be found.

still see the issue on Mac with the new release(4.11.0)! Im not sure if anyone else still sees it despite the change?

Please do that or join our chat to share your code. It takes longer to post things here and wait for answers. https://www.selenium.dev/support/

I also have this error with 115 on Mac. It doesn’t seem to be fixed in 4.11.0.

With 4.10.0 I get this error:

          Selenium::WebDriver::Error::UnknownError:
            unknown error: cannot find Chrome binary
          # 0   chromedriver                        0x0000000104cf6924 chromedriver + 4303140
          # 1   chromedriver                        0x0000000104cef050 chromedriver + 4272208
          # 2   chromedriver                        0x0000000104923328 chromedriver + 291624
          # 3   chromedriver                        0x000000010494ba7c chromedriver + 457340
          # 4   chromedriver                        0x000000010494affc chromedriver + 454652
          # 5   chromedriver                        0x000000010498a040 chromedriver + 712768
          # 6   chromedriver                        0x000000010498980c chromedriver + 710668
          # 7   chromedriver                        0x00000001049548d4 chromedriver + 493780
          # 8   chromedriver                        0x000000010495571c chromedriver + 497436
          # 9   chromedriver                        0x0000000104cb77dc chromedriver + 4044764
          # 10  chromedriver                        0x0000000104cbbd20 chromedriver + 4062496
          # 11  chromedriver                        0x0000000104cc1f40 chromedriver + 4087616
          # 12  chromedriver                        0x0000000104cbc824 chromedriver + 4065316
          # 13  chromedriver                        0x0000000104c94d1c chromedriver + 3902748
          # 14  chromedriver                        0x0000000104cd8414 chromedriver + 4178964
          # 15  chromedriver                        0x0000000104cd856c chromedriver + 4179308
          # 16  chromedriver                        0x0000000104ce8830 chromedriver + 4245552
          # 17  libsystem_pthread.dylib             0x00000001a4793fa8 _pthread_start + 148
          # 18  libsystem_pthread.dylib             0x00000001a478eda0 thread_start + 8
          # ./spec/rails_helper.rb:117:in `block (2 levels) in <top (required)>'

And with 4.11.0 (master) I get this error:

          Selenium::WebDriver::Error::NoSuchDriverError:
            Unable to obtain chromedriver using Selenium Manager; Selenium Manager binary located, but not a file: "/Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb/bin/macos/selenium-manager"; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
          # ./spec/rails_helper.rb:117:in `block (2 levels) in <top (required)>'

And it’s correct, this file does not exist: /Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb/bin/macos/selenium-manage

The rb directory exists, but it does not contain bin directory:

ls /Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb
BUILD.bazel                Gemfile                    README.md                  lib                        selenium-devtools.gemspec  spec
CHANGES                    Gemfile.lock               Rakefile                   ruby_version.bzl           selenium-webdriver.gemspec

Is there some installation stage that is missing when the gem is installed directly from github?

@Akkasim46 yes, that is the Chromium bug linked above.

I still see the issue with chrome version 115 on Mac. org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary

Yes, looks like there is an issue locating the default Chrome location — https://github.com/GoogleChromeLabs/chrome-for-testing/issues/30

@pmontrasio WD_CHROME_PATH is only used by webdrivers, so it shouldn’t do anything if you aren’t requiring the gem. Without webdrivers gem Selenium should be downloading chromedriver v114, which might give a warning, but will still work.