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

[rust] Use CfT endpoints to discover chromedriver 115+ #12208

Merged
merged 1 commit into from
Jun 16, 2023
Merged

Conversation

bonigarcia
Copy link
Member

@bonigarcia bonigarcia commented Jun 15, 2023

Description

The Chrome team is doing recently relevant changes related to Chrome for Testing (CfT). In particular, the metadata for discovering chromedriver as of version 115 is now different. This PR makes the required changes in the Rust-side of Selenium Manager to support chromedriver 115+ downloads using the new CfT endpoints.

Motivation and Context

This change is required to be shipped with the bindings at least when Chrome 115 is released as stable (according to the Chrome roadmap, by July 12, 2023).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @bonigarcia!

If I understand correctly, we try first the new endpoint, and if no ChromDriver is found there, we go back to LATEST_RELEASE, right?

And then, eventually, when Chrome 115 is released, the information for ChromeDriver will be present in the Chrome for Testing endpoints. I hope I got that one right.

@bonigarcia
Copy link
Member Author

Yes, something like that. Let me explain a bit.

First, we try to discover the browser (Chrome) version (by running some command(s) in the shell). Using the found version, there are different cases for discovering the driver (chromedriver) version:

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@diemol diemol merged commit c3b226c into trunk Jun 16, 2023
50 of 56 checks passed
@diemol diemol deleted the se_mgr_chrome115 branch June 16, 2023 08:23
@NathanSmeltzer
Copy link

If anyone is looking for a temporary fix until the next release, you can specify an older version in ChromeDriverManager:
ChromeDriverManager(version="114.0.5735.90")

@diemol
Copy link
Member

diemol commented Jul 19, 2023

ChromeDriverManager is not part of this project, that might be misleading for someone looking for a fix.

@titusfortner
Copy link
Member

@occamssafetyrazor you are mixing up the Selenium Manager which is in the Selenium code and the WebDriver Manager project, which is not.

It is confusing because @bonigarcia writes both. :)
Selenium has the fix for it, but we need to do another release, and we have a couple things holding it up, but hope to have something out shortly.

@Akkasim46
Copy link

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

@bonigarcia
Copy link
Member Author

bonigarcia commented Jul 20, 2023

@Akkasim46 That is due to a problem in chromedriver 115 in macOS (see GoogleChromeLabs/chrome-for-testing#30).

As a workaround in Selenium (and macOS), you can specify the Chrome binary path as follows (or its equivalent in other binding language):

ChromeOptions options = new ChromeOptions();
options.setBinary("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
WebDriver driver = new ChromeDriver(options);

@Akkasim46
Copy link

Thanks a lot @bonigarcia
It works!
will there be a permanent solution with a new webdrivermanager release?

@bonigarcia
Copy link
Member Author

The workaround will not be needed when the chromedriver team ships a new version of chromedriver 115 with the fix. Selenium or WebDriverManager does not cause it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants