-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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]: OpenQA.Selenium.WebDriverException : Unexpected error creating WebSocket DevTools session. #14714
Comments
@MJB222398, 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! |
This seems related to Firefox. I don't know how we can help with just a stack trace. |
@diemol There are logs from the selenium grid and driver too |
I know, but we have no context at all. I can only see the exception after interacting with Firefox. |
Have added simplified code to show what it was doing. Its throwing on the jsEngine.StartEventMonitoring() line |
I have tried the following: using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using var driver = new FirefoxDriver(new FirefoxOptions{ BrowserVersion = "128", EnableDevToolsProtocol = true });
var jsEngine = new JavaScriptEngine(driver);
await jsEngine.StartEventMonitoring(); It fails, and in webdriver output I see:
And in internal selenium dotnet logs I see:
Seems the issue should be addressed to Firefox. |
@MJB222398 given that you know how selenium library works internally, do you think this issue of library itself? Or it is more related to remote end? |
I'll pick this back up in a couple of days if thats OK. Lots of work at the moment that I need to prioritise. Hope thats OK |
@nvborisenko Do you mean you get that error every time with your code? Mine I see an error incredibly rarely. I'm not seeing the connection between your error and mine? I'm afraid I am not familiar enough with internal implementation for Selenium so cannot comment on where the root cause likely lies. |
What happened?
Jenkins running a 35 minutes worth of tests on Chrome, Edge, and Firefox in parallel using Docker selenium grid. Chrome and Edge tests all passed but 6/7 minutes in I had a Firefox one fail with the below exception. After this one failed test subsequent tests on Firefox were all fine. Tests runs following this were all fine and no code or environmental changes were made before or after this failure so the issue is intermittent.
OpenQA.Selenium.WebDriverException : Unexpected error creating WebSocket DevTools session.
----> System.TimeoutException : Could not connect to browser within 30 seconds
at OpenQA.Selenium.Remote.RemoteWebDriver.GetDevToolsSession(DevToolsOptions options)
at OpenQA.Selenium.Remote.RemoteWebDriver.GetDevToolsSession()
at OpenQA.Selenium.JavaScriptEngine.<>c__DisplayClass8_0.<.ctor>b__0()
at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)at System.Lazy`1.CreateValue()
at OpenQA.Selenium.JavaScriptEngine.StartEventMonitoring()
--TimeoutException
at OpenQA.Selenium.DevTools.WebSocketConnection.Start(String url)
at OpenQA.Selenium.DevTools.DevToolsSession.InitializeSocketConnection()
at OpenQA.Selenium.DevTools.DevToolsSession.StartSession()
at OpenQA.Selenium.Remote.RemoteWebDriver.<>c__DisplayClass29_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at OpenQA.Selenium.Remote.RemoteWebDriver.GetDevToolsSession(DevToolsOptions options)
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu
Selenium version
4.23.0
What are the browser(s) and version(s) where you see this issue?
Firefox 128.0
What are the browser driver(s) and version(s) where you see this issue?
moz:geckodriverVersion: 0.34.0
Are you using Selenium Grid?
4.23.0-20240727
The text was updated successfully, but these errors were encountered: