Jenkins with Webdriver falil to launch browser

2,873 views
Skip to first unread message

gaurang033

unread,
Aug 26, 2013, 5:32:08 AM8/26/13
to jenkins...@googlegroups.com
Hi Guys,

I have configured my maven project with jenkins. This maven project is a
webdriver automation project.

Project works find when i run from the command line, it launches the browser
and then shows that test case has passed.

However when i run the same project thorough jenkins it is not launching any
browser, however test result says that test case passed. Without any stack
trace or error I am not able to debug it either. Can someone let me know
what could have been wrong.

I am getting following output when I run though jenkins.
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.356 sec

Results :

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

[JENKINS] Recording test results
[JENKINS] Archiving C:\Users\gaurang_shah\workspace\MavenTest\pom.xml to
C:\Users\gaurang_shah\.jenkins\jobs\TestNGMavenDemo\modules\gaurang$MavenTest\builds\2013-08-26_14-51-48\archive\gaurang\MavenTest\0.0.1-SNAPSHOT\MavenTest-0.0.1-SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 44 seconds
[INFO] Finished at: Mon Aug 26 14:52:40 IST 2013
[INFO] Final Memory: 17M/42M
[INFO]
------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
Finished: SUCCESS



--
View this message in context: http://jenkins-ci.361315.n4.nabble.com/Jenkins-with-Webdriver-falil-to-launch-browser-tp4676970.html
Sent from the Jenkins users mailing list archive at Nabble.com.

JonathanRRogers

unread,
Aug 27, 2013, 4:58:59 PM8/27/13
to jenkins...@googlegroups.com

 There may be something missing from the environment when running from Jenkins that keeps the browser from starting. For example, in my setup, I have to make sure a headless X11 server is running and the Jenkins job has a DISPLAY variable set which points to the server. It looks like your job is running on Windows so I don't know what issues it might be specifically. Maybe the Jenkins process doesn't have permission to access the desktop or something?

Gaurang shah

unread,
Aug 29, 2013, 2:52:25 AM8/29/13
to jenkins...@googlegroups.com
Thanks Roger, 

For the update, however i figure out what was wrong. 

Earlier i was starting Jenkins from the war file and everything was working fine.  however after I install it as windows services it stopped working. 

After searching i realize that i require node to be created where i want my test case to run.  So i create JNLP node and now it works. 

However it would be really nice, if someone would explain me why i require JNLP node when i have started jenkins as windows services as i didn't require it when it was started as WAR file. 

Gaurang Shah

Eric Pyle

unread,
Aug 29, 2013, 8:28:07 AM8/29/13
to jenkins...@googlegroups.com
By default, Windows services run under the Local System account, which does not have access to the desktop. JNLP slaves run as the user logged in who starts up JNLP. Likewise, starting from a war file you run as the user who issues the startup command (java -jar jenkins.war).

Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andriy Shegera

unread,
Mar 31, 2019, 7:43:26 AM3/31/19
to Jenkins Users
Hello 
Gaurang Shah did you fixed this problem with no launch browser thru the Jenkins. If yes, can you share a solution, please? 
Thank you so much. 

Andriy
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

Mark Waite

unread,
Mar 31, 2019, 7:51:34 AM3/31/19
to Jenkins Users
The common solution is to create one or more agents that have access to the Windows desktop.  That is usually done by running the agents with JNLP from a batch file started on desktop login.

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5d1da479-d523-42c9-995f-15eea2a8aed8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite
Reply all
Reply to author
Forward
0 new messages