1

I have written an automation test script using Selenium WebDriver which will open up a browser and navigate to a site and then close the browser.

This is a Maven Project and since I use Eclipse, I am able to execute the project with 'Run As' -> 'Maven Test' and the project gets executed and the Build is Success in console.

But when I try to execute this same project through Jenkins, Jenkins cannot start the chromedriver.

Below is the console output:

Started by user QA Admin
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 42178
[WebdriverTest] $ java -Xms1024m -Xmx4096m -XX:PermSize=1024m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 42178
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /home/admin/workspace/WebdriverTest/pom.xml test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdriverTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ WebdriverTest ---
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Starting ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) on port 13012
Only local connections are allowed.
Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 61.125 sec <<< FAILURE! - in TestSuite
beforeTest(example.NewTest)  Time elapsed: 61.027 sec  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1),platform=Linux 3.16.0-77-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.22 seconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'AZDTPDE-L2', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-77-generic', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
    at example.NewTest.beforeTest(NewTest.java:31)


Results :

Failed tests: 
  NewTest.beforeTest:31 » WebDriver unknown error: Chrome failed to start: exite...

Tests run: 3, Failures: 1, Errors: 0, Skipped: 2

[ERROR] There are test failures.

Please refer to /home/admin/workspace/WebdriverTest/target/surefire-reports for the individual test results.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:07 min
[INFO] Finished at: 2016-08-26T12:09:35+05:30
[INFO] Final Memory: 28M/1059M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /home/admin/workspace/WebdriverTest/pom.xml to WebdriverTest/WebdriverTest/0.0.1-SNAPSHOT/WebdriverTest-0.0.1-SNAPSHOT.pom
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
channel stopped
Finished: UNSTABLE

I'm using Ubuntu 14.04 OS.

Any help is greatly appreciated. Thanks in advance. Please help. Any help?

Test admin
  • 711
  • 1
  • 11
  • 28
  • Have a look at this - http://stackoverflow.com/questions/22558077/unknown-error-chrome-failed-to-start-exited-abnormally-driver-info-chromedri – Grasshopper Aug 26 '16 at 07:23
  • No idea when viewed that link. – Test admin Aug 26 '16 at 07:45
  • Refer the mismatch of chrome driver from http://stackoverflow.com/questions/25080500/when-run-webdriver-with-chrome-browser-getting-message-only-local-connection – Harshavardhan Konakanchi Aug 26 '16 at 10:12
  • Didn't get any after visiting the link you mentioned. – Test admin Aug 26 '16 at 11:40
  • We use PhantomJS driver for Jenkins builds. We didn't find any benefits of using the "real" browser drivers (chrome, firefox, IE): they just cause problems, and don't really prove that it works on those browsers anyway. So we use the headless PhantomJS driver instead: it's also a bit quicker. – David Lavender Oct 07 '16 at 09:12
  • Thank You Mr.Spoon.. I don't have any idea in PhantomJS Driver. But I'll look into it and if its suitable, I'll use it for Jenkins. – Test admin Oct 07 '16 at 10:33
  • Which version of chrome you got? You seem to have a very old version of the chromedriver (2.23 whilst latest is 2.35) Donwload latest! – Xwris Stoixeia Feb 01 '18 at 02:02

0 Answers0