You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR raises NotImplementedError when trying to call get_downloadable_files() or download_file() on any local WebDriver. These methods are only available on the parent WebDriver class (AKA Remote).
This just makes the error thrown a little less cryptic for the user.
🔄 Types of changes
Bug fix
PR Type
Bug fix
Description
Raise NotImplementedError for download methods on local drivers
Improve error clarity for unsupported download operations
Affects Chromium, Firefox, IE, Safari, WebKitGTK, and WPEWebKit drivers
Changes walkthrough 📝
Relevant files
Bug fix
webdriver.py
Add NotImplementedError for download methods in Chromium driver
py/selenium/webdriver/chromium/webdriver.py
Added download_file and get_downloadable_files methods
The NotImplementedError is raised without a descriptive message explaining why these methods are not available on local WebDrivers or suggesting alternatives.
Add descriptive error messages to the NotImplementedError exceptions to inform users that these methods are not supported for local webdrivers. This provides clearer guidance on why the operation failed.
def download_file(self, *args, **kwargs):
- raise NotImplementedError+ raise NotImplementedError("The download_file method is not supported for local webdrivers")
def get_downloadable_files(self, *args, **kwargs):
- raise NotImplementedError+ raise NotImplementedError("The get_downloadable_files method is not supported for local webdrivers")
Apply / Chat
Suggestion importance[1-10]: 5
__
Why: Adding descriptive error messages to NotImplementedError improves developer experience by clarifying why the methods are not available, but it does not affect core functionality or correctness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
Fixes #15753
💥 What does this PR do?
This PR raises
NotImplementedErrorwhen trying to callget_downloadable_files()ordownload_file()on any local WebDriver. These methods are only available on the parentWebDriverclass (AKARemote).This just makes the error thrown a little less cryptic for the user.
🔄 Types of changes
PR Type
Bug fix
Description
Raise NotImplementedError for download methods on local drivers
Improve error clarity for unsupported download operations
Affects Chromium, Firefox, IE, Safari, WebKitGTK, and WPEWebKit drivers
Changes walkthrough 📝
webdriver.py
Add NotImplementedError for download methods in Chromium driverpy/selenium/webdriver/chromium/webdriver.py
webdriver.py
Add NotImplementedError for download methods in Firefox driverpy/selenium/webdriver/firefox/webdriver.py
webdriver.py
Add NotImplementedError for download methods in IE driverpy/selenium/webdriver/ie/webdriver.py
webdriver.py
Add NotImplementedError for download methods in Safari driverpy/selenium/webdriver/safari/webdriver.py
webdriver.py
Add NotImplementedError for download methods in WebKitGTK driverpy/selenium/webdriver/webkitgtk/webdriver.py
webdriver.py
Add NotImplementedError for download methods in WPEWebKit driverpy/selenium/webdriver/wpewebkit/webdriver.py