-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[🐛 Bug]: Python CDP library crashes on events from Chrome Beta #14420
Comments
@teqwve, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
We only package the DevTools protocol for the stable versions. In addition, we do not plan to invest more in CDP integration features because the time we have available is to integrate Selenium with WebDriver BiDi. |
Understood, thanks! |
I'm experiencing the same problem. If you don't plan to support CDP in the future, I think exception handling is necessary to at least skip non-existent event parser to maintain backward compatibility. In order to temporarily resolve this issue, I share how to force an empty parser to be added to class Dummy:
def from_json(cls, json):
pass
connection.devtools.util._event_parsers["Network.policyUpdated"] = Dummy() |
What happened?
When using CDB connection from Python and subscribing to network events in Chrome Beta the library fails on parsing messages with
KeyError: 'Network.policyUpdated'
.AFAIU it's so because
Network.policyUpdated
event is not present in devtools protocol used by current Chrome Stable and as a result is not included in the latest version of generated devtools protocol library included in Selenium.I'm not sure if it's really a bug since the documentation states that only the last 3 versions are supported, but I'd like to ask if you know any way to workaround this, or if it would be possible to ignore unknown events instead of crashing.
It should be sufficient to wrap event parsing with try-except (somewhere here) and log in case of an exception. To avoid hiding issues with stable versions this could be enabled only when matching devtools library was not found and the latest was used as a fallback (somewhere here). If like this idea I can prepare a PR.
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu 22.04
Selenium version
4.23.1
What are the browser(s) and version(s) where you see this issue?
Google Chrome for Testing 128.0.6613.36
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 128.0.6613.36
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: