Skip to content
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 : no such execution context #13920

Closed
MJB222398 opened this issue May 8, 2024 · 9 comments
Closed
Labels
G-chromedriver Requires fixes in ChromeDriver G-msedgedriver Requires fixes in MSEdgeDriver I-defect

Comments

@MJB222398
Copy link

What happened?

This is an intermittent issue (happening maybe once in 200 tests or so in my production solution).

Opened a RemoteWebDriver instance and attempted to navigate to a URL and got this exception:

OpenQA.Selenium.WebDriverException : no such execution context
  (Session info: MicrosoftEdge=123.0.2420.65)
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.set_Url(String value)

How can we reproduce the issue?

Can try to make this but won't be straight forward. Wondering if logs give enough to go on?

Relevant log output

Web Driver Logs:

2024-05-08 11:45:02.881 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"MicrosoftEdge","ms:edgeOptions":{"args":["--start-maximized","--disable-dev-shm-usage","--user-data-dir=/home/seluser/selenium/profile","--profile-directory=Default"]}}]}}
2024-05-08 11:45:02.881 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:4444/wd/hub/session', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:
{
  Accept: application/json; charset=utf-8
  Content-Type: application/json; charset=utf-8
}
2024-05-08 11:45:03.254 TRACE HttpCommandExecutor: << StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 1497
  Content-Type: application/json; charset=utf-8
}
2024-05-08 11:45:03.254 DEBUG HttpCommandExecutor: Response: (bbaa01d40eaea84113032366214e87e8 Success: System.Collections.Generic.Dictionary`2[System.String,System.Object])
2024-05-08 11:45:03.269 DEBUG HttpCommandExecutor: Executing command: [bbaa01d40eaea84113032366214e87e8]: get {"url":"https://mydomain.com/mypage"}
2024-05-08 11:45:03.269 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:4444/wd/hub/session/bbaa01d40eaea84113032366214e87e8/url', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:
{
  Accept: application/json; charset=utf-8
  Content-Type: application/json; charset=utf-8
}
2024-05-08 11:45:03.287 TRACE HttpCommandExecutor: << StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 1013
  Content-Type: application/json; charset=utf-8
}
2024-05-08 11:45:03.287 DEBUG HttpCommandExecutor: Response: ( UnhandledError: System.Collections.Generic.Dictionary`2[System.String,System.Object])

Edge Node Docker Container Logs:

10:45:03.251 INFO [LocalNode.newSession] - Session created by the Node. Id: bbaa01d40eaea84113032366214e87e8, Caps: Capabilities {acceptInsecureCerts: false, browserName: MicrosoftEdge, browserVersion: 123.0.2420.65, fedcm:accounts: true, ms:edgeOptions: {debuggerAddress: localhost:35887}, msedge: {msedgedriverVersion: 123.0.2420.53 (357a32c89da2..., userDataDir: /home/seluser/selenium/profile}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://localhost:4444/session..., se:cdpVersion: 123.0.2420.65, se:vnc: ws://localhost:4444/session..., se:vncEnabled: true, se:vncLocalAddress: ws://172.25.0.4:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
10:45:03.257 INFO [ProxyNodeWebsockets.createWsEndPoint] - Establishing connection to ws://localhost:35887/devtools/browser/12184d31-3896-403e-973c-6dfc4b651ff3
10:45:03.286 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "13161ea64cce8635ce1e0bf5016b8202","eventTime": 1715165103286441553,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "172.25.0.4:5555","http.method": "POST","http.request_content_length": "49","http.scheme": "HTTP","http.status_code": 400,"http.target": "\u002fsession\u002fbbaa01d40eaea84113032366214e87e8\u002furl","http.user_agent": "selenium\u002f4.19.0 (.net linux)"}}

10:45:04.736 INFO [SessionSlot.stop] - Stopping session bbaa01d40eaea84113032366214e87e8

Operating System

Ubuntu

Selenium version

4.19.0

What are the browser(s) and version(s) where you see this issue?

Edge 123.0.2420.65

What are the browser driver(s) and version(s) where you see this issue?

Edge 123.0.2420.65

Are you using Selenium Grid?

Yes 4.19.0-20240328

Copy link

github-actions bot commented May 8, 2024

@MJB222398, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@joerg1985
Copy link
Member

This is a typical chromedriver message, e.g. https://bugs.chromium.org/p/chromedriver/issues/detail?id=4474&can=2&q=no%20such%20execution%20context or https://bugs.chromium.org/p/chromedriver/issues/detail?id=4687&can=2&q=no%20such%20execution%20context

So i would expect this to happen without the grid and there is not mutch to do than report an chromedriver issue. I use a try / catch block in my java code to detect this and rerun another browser instance.

@MJB222398
Copy link
Author

MJB222398 commented May 20, 2024

@joerg1985 I don't believe I have ever seen this issue on Chrome, only on Edge.

@ChrstnAnsl
Copy link
Contributor

I created this PR #13978 to support the same issue that I have encountered, as I am also having some trouble on my end when there's not enough details to debug what's the primary issue that causing this no such execution context

@Irvinwop
Copy link

Irvinwop commented Jun 6, 2024

I've also seen this error when trying to call getPageSource.
It seems unreproducible so I just wrapped it in try/catch blocks and reran it

@diemol
Copy link
Member

diemol commented Jul 12, 2024

As mentioned, the error seems to come from the browser itself. If someone finds a way to reproduce it consistently, please report it to the browser folks through the links shown below.

@diemol diemol added G-chromedriver Requires fixes in ChromeDriver G-msedgedriver Requires fixes in MSEdgeDriver and removed needs-triaging labels Jul 12, 2024
Copy link

Hi, @MJB222398.
This issue has been determined to require fixes in MSEdgeDriver
or in the IE Mode in Edge.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an Issue with the MSEdgeDriver team.

Feel free to comment the issues that you raise back in this issue. Thank you.

Copy link

Hi, @MJB222398.
This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team.
Feel free to comment the issues that you raise back in this issue. Thank you.

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
G-chromedriver Requires fixes in ChromeDriver G-msedgedriver Requires fixes in MSEdgeDriver I-defect
Projects
None yet
Development

No branches or pull requests

5 participants