Closed sayom88 closed 4 years ago
As mentioned in https://github.com/markhobson/docker-maven-chrome/issues/21#issuecomment-633051283, your test is not running headlessly which causes this error.
Change:
ChromeOptions options = new ChromeOptions()
.setHeadless(false);
to:
ChromeOptions options = new ChromeOptions()
.setHeadless(true);
Hello, I have managed to create a dockerfile like yours and using the CHROME_VERSION=83.0.4103.61-1 and CHROME_DRIVER_VERSION=83.0.4103.39. Now when I am running the docker image, I get the below message. Can you please suggest what needs to be done here please. Thanks.
Running com.test.BrowserTest Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 3784 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping C[1590240042.256][SEVERE]: bind() failed: Cannot assign requested address (99) hromeDriver safe. ChromeDriver was started successfully. Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.434 sec <<< FAILURE! testGooglePage(com.test.BrowserTest) Time elapsed: 1.311 sec <<< ERROR! org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'dbe04168d487', ip: '172.17.0.4', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_252' Driver info: driver.version: ChromeDriver remote stacktrace: #0 0x5627cf111579
testGooglePage(com.test.BrowserTest) Time elapsed: 1.316 sec <<< ERROR! java.lang.NullPointerException at com.test.BrowserTest.tearDown(BrowserTest.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :
Tests in error: testGooglePage(com.test.BrowserTest): unknown error: Chrome failed to start: crashed.(..)