1

I am working on Jenkins to run my scripts but I am facing the following issue:

Running TestSuite Starting ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b) on port 7652 Only local connections are allowed. log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.2.0-29-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.44 seconds Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44' System info: host: 'hb-Veriton-Series', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-29-generic', java.version: '1.7.0_55' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:148) at com.hb.MFA.BaseClass.getDriver(BaseClass.java:146) at com.hb.MFA.BaseClass.configureDriver(BaseClass.java:44) at com.hb.MFA.DSW.setUp(DSW.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:348) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305) at org.testng.SuiteRunner.run(SuiteRunner.java:254) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95) EXCEPTION ::: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.2.0-29-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.44 seconds Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44' System info: host: 'hb-Veriton-Series', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-29-generic', java.version: '1.7.0_55' Driver info: org.openqa.selenium.chrome.ChromeDriver java.lang.NullPointerException at com.hb.Utility.Util.getscreenshot(Util.java:86) at com.hb.MFA.DSW.run(DSW.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:348) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305) at org.testng.SuiteRunner.run(SuiteRunner.java:254) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95) Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 62.704 sec <<< FAILURE! run(com.hb.MFA.DSW) Time elapsed: 0.322 sec <<< FAILURE! java.lang.AssertionError: null at org.testng.Assert.fail(Assert.java:94) at com.hb.MFA.DSW.run(DSW.java:64)

NOTE :: This was arising when I run jenkins on ubuntu server,when I run on windows mechaine everything was fine

1
  • 2
    you've got a NPE at com.hb.Utility.Util.getscreenshot(Util.java:86). What's done here?
    – exoddus
    Commented Jan 28, 2016 at 11:30

2 Answers 2

1

I was able to resolve this error by doing the following steps :-

1.Stop the jenkins service with the command - sudo /etc/init.d/jenkins start

2.Run Jenkins manually with the following command from command line/terminal :-

java -jar /usr/share/jenkins/jenkins.war –httpPort=8080

This solution is for Ubuntu 14.04 version. Windows OS needs to handle the different paths but essentially the solution should work

0

Are you passing the DISPLAY parameter to your Jenkins job?

By default Jenkins will try to run in headless mode. You need to setup Xvfb and pass the DISPLAY number to your job.


To add the the DISPLAY property

In you jenkins settings add a global property

key: DISPLAY

value: 0:0

On your server start Xvfb in the background:

Xvfb :0 -ac -screen 0 1024x768x24 &

6
  • YES. I did but no luck.I am still facing the same issue
    – QAMember
    Commented Oct 29, 2015 at 13:09
  • can you attach a log file? The error above is normally cause by what i highlighted, a log may help point to other potential issues.
    – ECiurleo
    Commented Oct 29, 2015 at 14:14
  • Please refer to this link : stackoverflow.com/questions/22558077/… Commented Oct 30, 2015 at 4:07
  • @JustARandomGuy, I have installed latest chromedriver,chrome browser,java (1.7 &1.6).I am able to run the script successfully through the terminal but jenkins fails to load the browser with same code and same configuration .Main thing is I was running jenkins on ubuntu server.In windows it was running successfully
    – QAMember
    Commented Oct 30, 2015 at 5:05
  • 1
    Is Jenkins using the same maven and JDK as in the command line?
    – dzieciou
    Commented Nov 29, 2015 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.