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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[馃悰 Bug]: WebDriver throws NullReferenceException when calling StartEventMonitoring with EventFiringWebDriver #10776
Comments
@elgatov, 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! |
When using a driver like EventFiringWebDriver as a parameter for JavaScriptEngine and trying to use StartEventMonitoring the constructor will throw a NullReferenceException. This is caused by casting the driver to IDevTools using "as" which will return null if the casting failed, and incorrectly checking the field "session" instead of "devToolsDriver" for null value. fixes SeleniumHQ#10776
When using a driver like EventFiringWebDriver as a parameter for JavaScriptEngine and trying to use StartEventMonitoring the constructor will throw a NullReferenceException. This is caused by casting the driver to IDevTools using "as" which will return null if the casting failed, and incorrectly checking the field "session" instead of "devToolsDriver" for null value. fixes SeleniumHQ#10776
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
Creating a
JavaScriptEngine
with anEventFiringWebDriver
as parameter will throw aNullReferenceException
when callingmonitor.StartEventMonitoring();
I believe line 57 in
selenium/dotnet/src/webdriver/JavaScriptEngine.cs
Lines 48 to 64 in 5713de4
should be changed to
if (devToolsDriver == null)
to correctly throw aWebDriverException
when trying to use a non-compatible webdriverHow can we reproduce the issue?
Relevant log output
Operating System
Windows 10
Selenium version
.Net Framework 4.8
What are the browser(s) and version(s) where you see this issue?
Chrome 102
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 102.0.5005.6102
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: