-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] Remove logging API for non-Chromium browsers #15641
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
Conversation
PR Code Suggestions ✨No code suggestions found for the PR. |
So I looked deeper at Ruby Selenium code, and we have a MixIn that allows users to call this method from Chromium. So maybe we just want to move this to Chromium driver class and not delete it entirely (sorry for my earlier mixup). |
OK, I'll update this PR in a little while (and also fix the linting error) |
09b8e12
to
ef248a5
Compare
It should be all set now... I updated the PR description also. I moved the logging methods to the Chromium WebDriver class, so it works in Chrome/Edge. I also adjusted the tests to be expected failures on all browsers except Chrome/Edge. ... just waiting for CI to run. |
SeleniumHQ/selenium#15641 Signed-off-by: Jens Langhammer <[email protected]>
* core: bump selenium from 4.31.0 to v4.32.0 * deal with selenium breaking stuff on minor versions SeleniumHQ/selenium#15641 Signed-off-by: Jens Langhammer <[email protected]> * format Signed-off-by: Jens Langhammer <[email protected]> --------- Signed-off-by: Jens Langhammer <[email protected]> Co-authored-by: Jens Langhammer <[email protected]>
Am I correct in understanding that this PR broke programs that call get_log from webdriver.Remote? The following code works fine in 4.31.0, but doesn't work in 4.32.0.
|
@cia2154 yes, that is correct. I will look into restoring it for remote chromedriver/edgedriver. |
@cgoldberg add those methods to here:
|
@titusfortner I tried to implement this, but I can't find a good way to add I don't see how adding those methods to I think we would need a pretty big restructuring of the class hierarchy to allow Chromium specific methods on a Maybe I'm missing something? |
Thinking about this some more... The only solution I can think of is to move the The methods on the base It's kind of ugly, but this would allow the logging API to be used for Chrome, Edge, and Remote drivers, and give a reasonable error when called from a local or remote driver that is not Chrome or Edge. |
You don't need to throw a not implemented error. There are a bunch of chromium specific features like casting that work with Remote driver. This isn't a great way to do it to reference subclasses this way, but it avoids mixins which Python people don't like: Literally just add those methods to the list above, and webdriver will add the commands to remote sessions that have that browser name |
None of the casting methods (like
It doesn't.
There is a method on So to use any of the commands listed in |
User description
🔗 Related Issues
Fixes #15588
Fixes #15589
Fixes #15587
Fixes #15586
💥 What does this PR do?
This PR changes the logging API in the Python bindings so it only works on Chromium based browsers (Chrome/Edge), as discussed in: #15588
It removes the related methods from the
selenium.webdriver.remote.webdriver.WebDriver
class and adds them toselenium.webdriver.chromium/webdriver.WebDriver
.Relevant tests have been updated so the are expected failures on all non-Chromium browsers.
This will bring the Python bindings in line with other language bindings where this has already been removed from most browsers.
🔄 Types of changes
PR Type
Bug fix, Enhancement