Skip to content

Fixed Webdrivers::VersionError with chrome version greater than 115#249

Closed
sadahiro-ono wants to merge 16 commits intotitusfortner:mainfrom
sadahiro-ono:bugfix_chromedriver
Closed

Fixed Webdrivers::VersionError with chrome version greater than 115#249
sadahiro-ono wants to merge 16 commits intotitusfortner:mainfrom
sadahiro-ono:bugfix_chromedriver

Conversation

@sadahiro-ono
Copy link
Contributor

similar Issue: #247

f the version is 115 or higher, the API can be used, so if the version is 115 or higher, the stable version is obtained and downloaded from the API.

refarence

@titusfortner titusfortner force-pushed the bugfix_chromedriver branch from 9ef214c to de1dffc Compare July 27, 2023 17:49
@titusfortner
Copy link
Owner

Thanks for the PR. It looks like it isn't backwards compatible. Can you look at why the tests are failing?

@sadahiro-ono
Copy link
Contributor Author

@titusfortner
Local tests passed, but I made some fixes to lower the impact, could you please run a CI?

@sadahiro-ono
Copy link
Contributor Author

@titusfortner
The main branch is also not passing the tests. I sorry, Could you please confirm this for me?
https://github.com/titusfortner/webdrivers/actions/runs/5683791993/job/15405104246

@alexshenia
Copy link

alexshenia commented Jul 28, 2023

expected StandardError with message matching /Net::HTTPServerException: 404 "Not Found"/, got #<Webdrivers::NetworkError: Net::HTTPClientException: 404 "Not Found" with https://github.com/mozilla/geckodriver/releases/download/v0.2.0/geckodriver-v0.2.0-linux64.tar.gz>

Just need to change from StandardError to Webdrivers::NetworkError

@alexshenia
Copy link

Webdrivers::NetworkError: Net::HTTPClientException: 404 "Not Found" with https://msedgedriver.azureedge.net/114.0.1823.90/edgedriver_mac64.zip
https://msedgedriver.azureedge.net/ does not have this build 114.0.1823.90/edgedriver_mac64.zip

@titusfortner titusfortner force-pushed the bugfix_chromedriver branch from 8438f32 to 4378b7d Compare July 28, 2023 15:39
@titusfortner
Copy link
Owner

StandardError is the superclass, it is the value of the String it failed on. Not sure if it is happenstance or common that MS doesn't do releases for all platforms for all patch versions, but not good either way.

Copy link
Owner

@titusfortner titusfortner left a comment

Choose a reason for hiding this comment

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

  1. Thanks for putting this together and adding tests
  2. I really hate looking at old code I've written.
  3. We probably need to exclude chromedriver.rb from Metrics/ClassLength in .rubocop.yml.

"#{msg} A network issue is preventing determination of latest chromedriver release."
end

url = if version >= normalize_version('115')
Copy link
Owner

Choose a reason for hiding this comment

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

current_build_version == browser_build_version)
end

def chrome_for_testing_base_url
Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to support a version that we cannot get from this endpoint?
I believe we can change the base_url to the API endpoint if we don't need it.

Copy link
Owner

Choose a reason for hiding this comment

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

yes, we still need to support the older versions

'linux64'
elsif System.platform == 'mac'
apple_filename(driver_version)
if driver_version >= normalize_version('115')
Copy link
Owner

Choose a reason for hiding this comment

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

If we move this conditional to #apple_filename we don't need to add #apple_filename_api.

allow(chromedriver).to receive(:exists?).and_return(false)

msg = %r{Can not reach https://chromedriver.storage.googleapis.com}
msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
Copy link

@yykamei yykamei Jul 31, 2023

Choose a reason for hiding this comment

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

How about considering the both cases for v115+ and v114 or earlier? The Gem is expected to print "Can not reach ...", and the target URL is not important here.

Suggested change
msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
msg = %r{Can not reach (?:https://googlechromelabs.github.io|https://chromedriver.storage.googleapis.com)}

allow(Net::HTTP).to receive(:get_response).and_raise(SocketError)

msg = %r{Can not reach https://chromedriver.storage.googleapis.com/}
msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
Copy link

@yykamei yykamei Jul 31, 2023

Choose a reason for hiding this comment

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

Suggested change
msg = %r{Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
msg = %r{Can not reach (?:https://googlechromelabs.github.io|https://chromedriver.storage.googleapis.com)}

allow(Net::HTTP).to receive(:get_response).and_raise(SocketError)

msg = %r{^Can not reach https://chromedriver.storage.googleapis.com}
msg = %r{^Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
Copy link

@yykamei yykamei Jul 31, 2023

Choose a reason for hiding this comment

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

Suggested change
msg = %r{^Can not reach https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json}
msg = %r{Can not reach (?:https://googlechromelabs.github.io|https://chromedriver.storage.googleapis.com)}

@titusfortner
Copy link
Owner

Merged here — 97fb1e2

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants