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]: JavaScript code failed from unknown command: 'Runtime.evaluate' wasn't found #15358

Open
bonigarcia opened this issue Mar 2, 2025 · 6 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended

Comments

@bonigarcia
Copy link
Member

bonigarcia commented Mar 2, 2025

What happened?

The following Selenium Java test used to work, but it has started to fail in GitHub Actions:

https://github.com/bonigarcia/selenium-webdriver-java/blob/master/selenium-webdriver-junit5/src/test/java/io/github/bonigarcia/webdriver/jupiter/ch04/window/WindowJupiterTest.java

How can we reproduce the issue?

The error points directly to this line:

driver.manage().window().maximize();

Relevant log output

Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.893 s <<< FAILURE! -- in io.github.bonigarcia.webdriver.jupiter.ch04.window.WindowJupiterTest
Error:  io.github.bonigarcia.webdriver.jupiter.ch04.window.WindowJupiterTest.testWindow -- Time elapsed: 3.889 s <<< ERROR!
org.openqa.selenium.WebDriverException: 
unknown error: JavaScript code failed
from unknown command: 'Runtime.evaluate' wasn't found
  (Session info: chrome=133.0.6943.126)
Build info: version: '4.29.0', revision: '5fc1ec94cb'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.8.0-1021-azure', java.version: '17.0.14'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [da63b9680b9a3e4442d3a12258ea9e74, maximizeCurrentWindow {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 133.0.6943.126, chrome: {chromedriverVersion: 133.0.6943.141 (2a5d6da0d61..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:36033}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://localhost:36033/devtoo..., se:cdpVersion: 133.0.6943.126, 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}
Session ID: da63b9680b9a3e4442d3a12258ea9e74
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:215)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:1061)
	at io.github.bonigarcia.webdriver.jupiter.ch04.window.WindowJupiterTest.testWindow(WindowJupiterTest.java:65)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

See complete logs here: https://github.com/bonigarcia/selenium-webdriver-java/actions/runs/13614712277/job/38056290843

Operating System

Ubuntu 24.04 (ubuntu-latest in GHA)

Selenium version

selenium-java 4.29.0

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

Chrome 133

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

chromedriver 133.0.6943.141

Are you using Selenium Grid?

No

@bonigarcia bonigarcia added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Mar 2, 2025
Copy link

github-actions bot commented Mar 2, 2025

@bonigarcia, 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!

@Delta456
Copy link
Member

Delta456 commented Mar 2, 2025

Is there a way to find from which commit it started to cause the issue?

@rdaugherty
Copy link

I ran into this exact error on the maximize() method about 3 weeks ago using dotnet and running from Github Actions. At the time the error occurred, there had been no code changes in our repository, nor did I see any new Selenium releases that could have changed anything. The only difference I found between the successful run from the night before and the failing run was the github runner image updated, which included and update from Chrome v132 to v133. Here is the update: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250209.1

Our workaround was to set the Manage().Window.Size property directly.

Note: There is a newer github runner image (20250223), and I have tried to use the maximize() method and ran into the same issue as well.

@e-ed
Copy link

e-ed commented Mar 6, 2025

I ran into this exact error on the maximize() method about 3 weeks ago using dotnet and running from Github Actions. At the time the error occurred, there had been no code changes in our repository, nor did I see any new Selenium releases that could have changed anything. The only difference I found between the successful run from the night before and the failing run was the github runner image updated, which included and update from Chrome v132 to v133. Here is the update: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250209.1

Our workaround was to set the Manage().Window.Size property directly.

Note: There is a newer github runner image (20250223), and I have tried to use the maximize() method and ran into the same issue as well.

From my personal experience, it seems to be an issue with Chrome 133+ and current implementation of maximize() with Linux

@Wolfe1
Copy link

Wolfe1 commented Mar 7, 2025

Running into this issue fairly consistently in Github Actions when using Chrome 133 and 134 now when maximize is called.

  Test.GUI.GUITests :: Zoomba GUI Library Tests                         | FAIL |
  Suite setup failed:
  WebDriverException: Message: unknown error: JavaScript code failed
  from unknown command: 'Runtime.evaluate' wasn't found
    (Session info: chrome=134.0.6998.35)
  Stacktrace:

Additionally we have users using selenium grid that are getting periodic errors when attempting to sue a keyword to maximize the browser but it is much more sporadic there.

Reverting to Chrome 132 seems to prevent this issue in both cases.

@ghostwords
Copy link

ghostwords commented Mar 13, 2025

Chromium issue tracker issue 394760806: Chromedriver crash on maximize() function on Linux with Xvfb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended
Projects
None yet
Development

No branches or pull requests

6 participants