-
Notifications
You must be signed in to change notification settings - Fork 80
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 requires a Chrome for Testing binary by default #30
Comments
@mathiasbynens could you look at this as a priority? |
Thanks for the report! We didn’t make any changes to ChromeDriver itself, just to the release process and where the ZIP files get uploaded. Could you elaborate which part of ChromeDriver “expects” a CfT binary? |
On Linux Chomedriver 115 finds Chrome (running default settings). When I test on a Mac (both arm/intel) Chromedriver 115 doesn't find Chrome 115. If I set the binary path to the Chrome binary it works. If I switch to Chromedriver 114 it works. I'm running without Chrome for Testing installed. |
It’s clear there is some kind of issue, but it cannot be because of any new logic in ChromeDriver to find the Chrome binary, because we made no changes to that code. We certainly don’t “require” the use of CfT for the Chrome binaries. The issue must be related to the way we package up the ChromeDriver binaries as distributed via CfT infra. Here’s a comparison. ChromeDriver 114 (old download location):
ChromeDriver 115 (new download location):
The main difference is that the |
@thiagowfx, https://chromium-review.googlesource.com/c/chromium/src/+/4101520 added Chrome for Testing to the list of known browser locations on Windows. Given the above, do we need something similar for macOS? |
Looking into the history of https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/chrome/chrome_finder.cc;bpv=1;bpt=0, nothing has significantly changed recently (last change was on Jan 23rd this year). It seems the current workaround is to manually provide the browser path, and the issue is with the defaults, the system Chrome browser is not being properly detected, correct? |
Exactly, the defaults seems to not work anymore on macOS at least. |
We figured out what the issue is. Will try to send a fix shortly.
However, that is hard-coded in |
Shifting issue to the Chromium bug tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1466427. Will keep this one open (e.g. maybe to figure out cherry-picking and/or patching M115), but refer to the other one from now on for the underlying issue. |
Thank you for checking, @thiagowfx! |
The issue affects macOS only. Here's the current list of workarounds:
ln -s "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" "/Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
|
As a workaround for Selenium (and macOS), we need to specify the Chrome binary path as follows (this is Java, although the equivalence in other binding languages will do the trick as well):
|
The fix has been landed. We're currently looking into the feasibility of releasing a backmerge for M115. |
Back-merges: |
Why is this not widely announced? At the very least at https://twitter.com/ChromeDevTools? This is extremely disruptive, especially due to:
|
The symlink works for me, but with caveats:
Commands I used: sudo ln -s "/Applications/Google Chrome.app" "/Applications/Google Chrome for Testing.app"
sudo ln -s "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" "/Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing" |
Thanks for testing, Domenic. x-posting for visibility (https://bugs.chromium.org/p/chromium/issues/detail?id=1466427#c27): From @mathiasbynens:
|
This is a reasonable point. Feel free to file a bug at https://crbug.com/new. |
What worked for me was downloading "Google Chrome for Testing" and copying it over to my
Then Chromedriver was able to find this. |
FWIW, the Gatekeeper thing is documented here: https://github.com/GoogleChromeLabs/chrome-for-testing#macos-says-the-app-is-damaged-what-now We recommend using |
I tried. But I can't. It requires a Google account, which I don't have. 😅 Could you please file one on my behalf? 🙏 |
Chrome for Testing 115.0.5790.170 is out now and should include the backported fix. Please try it out and let us know if this resolves the issues. |
@mathiasbynens It's working for me now. Thank you for the fix! |
so how do I get this fix now? Is updating Chrome all that's required? Thanks |
Update to the latest ChromeDriver 115.0.5790.170 (or more recent). |
Use latest chromedriver version that fixes a bug in the chrome binary resolution and solves the error: An error occurred while creating a new ChromeDriver session: [WebDriverError] unknown error: cannot find Chrome binary See: GoogleChromeLabs/chrome-for-testing#30 and: https://bugs.chromium.org/p/chromium/issues/detail?id=1466427
Use latest chromedriver version that fixes a bug in the chrome binary resolution and solves the error: An error occurred while creating a new ChromeDriver session: [WebDriverError] unknown error: cannot find Chrome binary See: GoogleChromeLabs/chrome-for-testing#30 and: https://bugs.chromium.org/p/chromium/issues/detail?id=1466427
I am not able to use it by using python. Can anyone please share a sample code in python, how to use the new version? |
|
I have the following to handle chrome driver, but I do not seem to make them work :( The following is in my build.gradle file:
The following is in my SupportedWebDriver class which my manager has setup:
|
@ryanbuckner @debidatta650 @kazi-rashedul-haque If you upgrade to Selenium 4.11+ (and delete any existing drivers on the system), then Selenium will manage the drivers and the Chrome version for you without you needing to do anything. If you want a specific version of Chrome, set it on the options class
You don't have to set the driver location or the browser location, Selenium does it all! |
Thanks @titusfortner I was able to launch the Google Chrome for Testing browser but my test case is not running.
Any idea what might be the solution? |
@kazi-rashedul-haque If it does not explain it, open a ticket with Selenium (https://github.com/SeleniumHQ/selenium/issues) and include the logging output |
As we are starting to add support for Chrome for Testing in Selenium, we have noticed that when using ChromeDriver 115, it expects a Chrome for Testing binary, and it will only use the already installed regular Chrome if the location is passed through the
goog:chromeOptions
section.Not sure if we missed that detail or if it needs to be documented.
Is it possible to have as default behavior in ChromeDriver to use the already installed "regular" Chrome binary? Almost every one using ChromeDriver right now follows that thought. Perhaps a new flag in ChromeDriver that does that.
Thanks!
The text was updated successfully, but these errors were encountered: