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

[py]: Find latest version of devtools when requested version does not exist on disk #10749

Merged
merged 3 commits into from
Jun 13, 2022

Conversation

symonk
Copy link
Member

@symonk symonk commented Jun 8, 2022

This adds a little resilliency to the python bindings when the requested devtools/v{n} cannot be found on disk. This can happen when CDP is updated and python has not yet been released. It will parse out all the version available in the /devtools/* path and select the latest one only if the requested ver is not available and raises a ModuleNotFoundError.

This makes a few assumptions that the only contents in /devtools will be folders prefixed with v{some_number}.

closes #10699

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

Codecov Report

Merging #10749 (01f5eca) into trunk (4bbb7c2) will increase coverage by 0.03%.
The diff coverage is 46.15%.

@@            Coverage Diff             @@
##            trunk   #10749      +/-   ##
==========================================
+ Coverage   47.27%   47.30%   +0.03%     
==========================================
  Files          86       86              
  Lines        5580     5589       +9     
  Branches      278      278              
==========================================
+ Hits         2638     2644       +6     
- Misses       2664     2667       +3     
  Partials      278      278              
Impacted Files Coverage Δ
py/selenium/webdriver/remote/webdriver.py 37.42% <0.00%> (+0.14%) ⬆️
py/selenium/webdriver/common/bidi/cdp.py 24.88% <50.00%> (+1.58%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bbb7c2...01f5eca. Read the comment docs.

@symonk symonk added this to the 4.3 milestone Jun 10, 2022
@diemol diemol requested a review from AutomatedTester June 13, 2022 07:11
@symonk symonk merged commit a4146c0 into SeleniumHQ:trunk Jun 13, 2022
@symonk symonk deleted the fallback-to-older-cdp-modules branch June 13, 2022 15:56
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
… not exist on disk (SeleniumHQ#10749)

* [py]: Allow `devtools` imports to look for the latest version if the request version does not exist on disk

* [py]: use `selenium` logger for `devtools` fallback

Co-authored-by: David Burns <[email protected]>
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.

[🐛 Bug]: Same error with every new chrome version when using bidi_connection()
3 participants