Repository navigation
Closed
Labels
A-needs-triagingA Selenium member will evaluate this soon!C-javaJava BindingsI-defectSomething is not working as intended
Description
What happened?
I have Selenium Java tests failing on both Jenkins Pipeline and locally.
An example of Dockerfile:
FROM maven:3.9.4-amazoncorretto-21-al2023
RUN yum update -y && \
yum install -y unzip xorg-x11-server-Xvfb gtk3-devel alsa-lib
WORKDIR /app
COPY . /app
RUN mvn clean verify
the test is nothing:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.annotations.*;
public class FailTest {
WebDriver driver;
@Test
public void testAsdf() {
ChromeOptions options = new ChromeOptions();
System.setProperty("SE_DEBUG", "true");
System.setProperty("SE_TRACE", "true");
options.addArguments("--headless=new");
driver = new ChromeDriver(options);
driver.get("http://www.google.com");
}
}
Using:
- Selenium 4.27.0
- TestNG 7.8.0
- Java 21
- Maven
How can we reproduce the issue?
docker build -t asdf .Relevant log output
18.18 [INFO]
18.18 [INFO] -------------------------------------------------------
18.18 [INFO] T E S T S
18.18 [INFO] -------------------------------------------------------
18.32 [INFO] Running TestSuite
18.39 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
18.39 SLF4J: Defaulting to no-operation (NOP) logger implementation
18.40 SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
18.49 ...
18.49 ... TestNG 7.8.0 by Cédric Beust (cedric@beust.com)
18.49 ...
18.49
58.71 [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 40.37 s <<< FAILURE! -- in TestSuite
58.71 [ERROR] tests.FailTest.testAsdf -- Time elapsed: 40.04 s <<< FAILURE!
58.71 org.openqa.selenium.remote.NoSuchDriverException:
58.71 Unable to obtain: chromedriver, error Failed to parse json output, executed: [--browser, chrome, --language-binding, java, --output, json]
58.71 rome/linux64/131.0.6778.85/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"
58.71 },
58.71 {
58.71 "level": "TRACE",
58.71 "timestamp": 1732737672,
58.71 "message": "Copying /tmp/selenium-managerUAfrP9/WidevineCdm/manifest.json to /root/.cache/selenium/chrome/linux64/131.0.6778.85/WidevineCdm/manifest.json"
58.71 },
...
58.71 {
58.71 "level": "TRACE",
58.71 "timestamp": 1732737674,
58.71 "message": "URLs for CfT: [PlatformUrl { platform: \"linux64\", url: \"https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chromedriver-linux64.zip\" }]"
58.71 },
...
58.71 {
58.71 "level": "INFO",
58.71 "timestamp": 1732737679,
58.71 "message": "Browser path: /root/.cache/selenium/chrome/linux64/131.0.6778.85/chrome"
58.71 }
58.71 ],
58.71 "result": {
58.71 "code": 0,
58.71 "message": "",
58.71 "driver_path": "/root/.cache/selenium/chromedriver/linux64/131.0.6778.85/chromedriver",
58.71 "browser_path": "/root/.cache/selenium/chrome/linux64/131.0.6778.85/chrome"
58.71 }
58.71 }
58.71 at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:121)
58.71 at org.openqa.selenium.remote.service.DriverFinder.getDriverPath(DriverFinder.java:55)
58.71 at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99)
58.71 at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
58.71 at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
58.71 at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)
58.71 at tests.FailTest.testAsdf(FailTest.java:20)
58.71 at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
58.71 at java.base/java.lang.reflect.Method.invoke(Method.java:580)
58.71 at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
58.71 at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:664)
58.71 at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
58.71 at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
58.71 at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
58.71 at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
58.71 at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
58.71 at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
58.71 at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
58.71 at org.testng.TestRunner.privateRun(TestRunner.java:848)
58.71 at org.testng.TestRunner.run(TestRunner.java:621)
58.71 at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
58.71 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437)
58.71 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397)
58.71 at org.testng.SuiteRunner.run(SuiteRunner.java:336)
58.71 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
58.71 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
58.71 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280)
58.71 at org.testng.TestNG.runSuitesLocally(TestNG.java:1200)
58.71 at org.testng.TestNG.runSuites(TestNG.java:1114)
58.71 at org.testng.TestNG.run(TestNG.java:1082)
58.71 at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:308)
58.71 at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:71)
58.71 at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
58.71 at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
58.71 at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
58.71 at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
58.71 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
58.71 Caused by: org.openqa.selenium.WebDriverException: Failed to parse json output, executed: [--browser, chrome, --language-binding, java, --output, json]
58.71 rome/linux64/131.0.6778.85/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"
58.71 },
58.71 {
...
58.71 {
58.71 "level": "INFO",
58.71 "timestamp": 1732737679,
58.71 "message": "Browser path: /root/.cache/selenium/chrome/linux64/131.0.6778.85/chrome"
58.71 }
58.71 ],
58.71 "result": {
58.71 "code": 0,
58.71 "message": "",
58.71 "driver_path": "/root/.cache/selenium/chromedriver/linux64/131.0.6778.85/chromedriver",
58.71 "browser_path": "/root/.cache/selenium/chrome/linux64/131.0.6778.85/chrome"
58.71 }
58.71 }
58.71 at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:174)
58.71 at org.openqa.selenium.manager.SeleniumManager.getBinaryPaths(SeleniumManager.java:251)
58.71 at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:102)
58.71 ... 36 more
58.71 Caused by: org.openqa.selenium.json.JsonException: Unable to parse: rome/linux64/131.0.6778.85/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"
58.71 },
...
58.74 {
58.74 "level": "TRACE",
58.74 "timestamp": 1732737674,
58.74 "message": "URLs for CfT: [PlatformUrl { platform: \"linux64\", url: \"https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chromedriver-linux64.zip\" }]"
58.74 },
...
58.74 ],
58.74 "result": {
58.74 "code": 0,
58.74 "message": "",
58.74 "driver_path": "/root/.cache/selenium/chromedriver/linux64/131.0.6778.85/chromedriver",
58.74 "browser_path": "/root/.cache/selenium/chrome/linux64/131.0.6778.85/chrome"
58.74 }
58.74 }
58.74 [INFO]
58.74 [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
58.74 [INFO]
58.74 [INFO] ------------------------------------------------------------------------
58.74 [INFO] BUILD FAILURE
58.74 [INFO] ------------------------------------------------------------------------
58.74 [INFO] Total time: 57.648 s
58.74 [INFO] Finished at: 2024-11-27T20:01:19Z
58.74 [INFO] ------------------------------------------------------------------------
58.75 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project E2EProject: There are test failures.
58.75 [ERROR]
58.75 [ERROR] Please refer to /app/target/surefire-reports for the individual test results.
58.75 [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
58.75 [ERROR] -> [Help 1]
58.75 [ERROR]
58.75 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
58.75 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
58.75 [ERROR]
58.75 [ERROR] For more information about the errors and possible solutions, please read the following articles:
58.75 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
------
Dockerfile:9
--------------------
7 | COPY . /app
8 |
9 | >>> RUN mvn clean verify
--------------------
ERROR: failed to solve: process "/bin/sh -c mvn clean verify" did not complete successfully: exit code: 1Operating System
Mac M1 PRO Sonoma 14.5
Selenium version
4.27.0
What are the browser(s) and version(s) where you see this issue?
Chrome latest
What are the browser driver(s) and version(s) where you see this issue?
Chromedriver latest
Are you using Selenium Grid?
No response
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!C-javaJava BindingsI-defectSomething is not working as intended
Activity
github-actions commentedon Nov 27, 2024
@edudelta, 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-templatelabel.If the issue is a question, add the
I-questionlabel.If the issue is valid but there is no time to troubleshoot it, consider adding the
help wantedlabel.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 answerlabel.Thank you!
joerg1985 commentedon Nov 27, 2024
@edudelta thanks for reporting, could you share the complete output or confirm my assumtion? I assume it does exceed the max size of the buffer of 32kb and will be truncated. If so, this is a easy fix.
edudelta commentedon Nov 28, 2024
Hi @joerg1985 ! Thanks for answering
Attached the log.
fulllog.txt
[java] read complete output of selenium manager #14820
joerg1985 commentedon Nov 28, 2024
@edudelta this issue is fixed in the next release, thanks again for reporting. In the meantime, until it is relased, you could set SE_TRACE to false.
edudelta commentedon Nov 28, 2024
Hi @joerg1985 thank you, but, sorry, the issue is still there:
org.openqa.selenium.SessionNotCreatedException:
55.29 Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
joerg1985 commentedon Nov 28, 2024
Did you try to set SE_DEBUG also to false?
edudelta commentedon Nov 28, 2024
Yes. I only added for logging purposes.
joerg1985 commentedon Nov 28, 2024
You could try to use the next nightly releases build.
edudelta commentedon Dec 8, 2024
Hi @joerg1985 Sorry for the delay.
Using the 4.28.0-SNAPSHOT The logging looks better but it still not running the tests. Should I create a new issue?
joerg1985 commentedon Dec 8, 2024
@edudelta this does not look like the original issue, so i assue this is related to something else.
Are you running chrome with the arguments needed for docker?
This should be at least
--headless=newand--no-sandbox, maybe more.There is also a selenium chrome docker image you could try to start from.
edudelta commentedon Dec 8, 2024
@joerg1985 The previous log was running with
but it is still failing.
Weird... it was running ok until ~28th October.
Should I try another docker image?
joerg1985 commentedon Dec 8, 2024
I have modified the error messes in
cc58a4eto get the exit code of the chromedriver this might help to find the reason for this. The best would be to get the chromedriver logs from the docker container, but i don't know how to do this.@VietND96 do you know how to get the logs from docker?
edudelta commentedon Dec 8, 2024
@joerg1985 I got to create the file but the file for this case is empty. Loos like it not even raising the chrome.
I used:
where when running locally it has the logs:
Empty in the docker, though.
edudelta commentedon Dec 9, 2024
Hi! I just made some tests here using standalone-chromium (for Mac M1) docker image.
From the error I have:
This is kind of same error I have on Jenkins using Linux AMD64:
Looks like selenium manager is failing to download/install Chrome on docker?
joerg1985 commentedon Dec 9, 2024
I think it might be best to open a issue in the selenium-docker repo to have a look at this.
VietND96 commentedon Dec 10, 2024
If the image is
standalone-chromium, when starting the container, set the env varSE_LOG_LEVEL=FINESTto see more logs from the container.VietND96 commentedon Dec 10, 2024
This is arch ARM64/aarch64, I don't think selenium-manager can download and launch the Google Chrome.
When inspecting SM impl https://github.com/SeleniumHQ/selenium/blob/trunk/rust/src/chrome.rs, it will download the official Chrome binary only (
google-chrome).However,
google-chromestill not support officially for Linux/ARM64 (that is the reason ofstandalone-chromiumdocker image was built). Moreover, assume that SM can configure/usr/bin/google-chrome, but it might trouble to launch the binary due to not support Arch.So, I am thinking that if above scenario is happing with the docker image
standalone-chrome(running on a host AMD64), then it would be an issue. Otherwise, it is recommended to useSE_OFFLINE=trueor use a pre-built browser/driver in the containerstandalone-chromium.edudelta commentedon Dec 10, 2024
@VietND96 as mentioned, this is the same issue I'm facing on Jenkins with Linux adm64.
Added SE_LOG_LEVEL=FINEST does not make better logs. Nothing to add from what we have so far.
I will try to use selenium-standalone for the Jenkins asap.
thank you all
github-actions commentedon Jan 9, 2025
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.