Selenium + Jenkins,Could not start Browser, but it works locally

12,171 views
Skip to first unread message

Daniel S

unread,
Apr 12, 2012, 12:09:28 PM4/12/12
to Selenium Users
Hello,

we implemented a testautomation and it works locally very good, but we
want it run on our Server, too.
So we created a jenkins build for the testautomation and we got
following error:

Could not start Selenium session: Failed to start new browser session:
Error while launching browser

Is it possible,that there are problems because it runs in a tomcat
service and so it doesn't have it's own "graphical interface"?
If you need more information, don't hesitate to ask.

Kind regards,
Daniel

Krishnan Mahadevan

unread,
Apr 12, 2012, 9:21:44 PM4/12/12
to seleniu...@googlegroups.com
Daniel
You would need to provide more info. 
How are you instantiating selenium? Webdriver or defaultselenium?
Is grid involved?
What version of selenium?
What browser?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.



--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

François Reynaud

unread,
Apr 13, 2012, 3:49:03 AM4/13/12
to seleniu...@googlegroups.com
browsers only work if they have a dislay. You can't pop them without.

Felix Lu

unread,
Apr 13, 2012, 10:31:59 AM4/13/12
to seleniu...@googlegroups.com
Maybe you can try the XVNC plugin for Jenkins.


2012/4/13 François Reynaud <francois...@gmail.com>:

Fernando Cervera

unread,
Apr 13, 2012, 4:07:24 PM4/13/12
to seleniu...@googlegroups.com
In case that you are running Jenkins as a windows service, you should either activate the checkbox "Allow service to interact with desktop" on the service, or just run it from the console with "java -jar jenkins.war". The later option is what i'm using at this moment.

Hope it helps.

vikas shukla

unread,
Apr 14, 2012, 4:11:28 AM4/14/12
to Selenium Users
Hiii,

Did u added the selenium grid plugin in your Jenkins.

Daniel S

unread,
Apr 17, 2012, 7:54:58 AM4/17/12
to Selenium Users
Thank you for your answer.

On the tomcat service GUI you can activate "Allow service to interact
with desktop" only with a local user, and in this case all works
fine.
But we need to use another User for the service, and then its
impossible to check the checkbox. Is there a workaround?

Kind regards
Daniel

On Apr 13, 10:07 pm, Fernando Cervera <fernandogcerv...@gmail.com>
wrote:

Krishnan Mahadevan

unread,
Apr 17, 2012, 7:56:35 AM4/17/12
to seleniu...@googlegroups.com
I thought you could configure a service to run as a specific user from windows services. So wouldnt you be able to configure tom cat itself to run as the other user ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



RonQ

unread,
Jun 4, 2012, 1:09:10 PM6/4/12
to Selenium Users
Did anyone ever provide a solution regarding this? I ran into the
same issue. I too notice that you can only select "Allow service to
interact with desktop" when you use a local user. Since we use a non-
local user for our CM builds, I was not able to do this. I opted for
the option of running Jenkins through the console on the build node.
I created a shortcut for it and put it in the Startup folder to ensure
start-up on restart. That seems to work, but if anyone has a solution
for getting the UI to work though the service method I think that
would be ideal.

Best regards,
Ron

RonQ

unread,
Jun 8, 2012, 2:56:54 PM6/8/12
to Selenium Users
I have not seen a response to this, but I wanted to post my solution.
It may not be fitting for all, but it's definitely a working setup for
us.

We ended up leaving Jenkins as a service, but instead of having any
build script launching SE server, we setup the build nodes to launch
SE server through the console command on startup on each node. That
means it will be running constantly on those nodes. We are using
Windows machines with a batch file kicking off the launch on startup,
but I'm sure the same can be done on a Linux based OS with a shell
script or cron job.

This may not be the best solution for everyone, but it's currently
working for us.

On Jun 4, 10:09 am, RonQ <ronquin...@gmail.com> wrote:
> Did anyone ever provide a solution regarding this?  I ran into the
> same issue.  I too notice that you can only select "Allowserviceto
> interact with desktop" when you use a local user.  Since we use a non-
> local user for our CM builds, I was not able to do this.  I opted for
> the option of runningJenkinsthrough the console on the build node.
> I created a shortcut for it and put it in the Startup folder to ensure
> start-up on restart.  That seems to work, but if anyone has a solution
> for getting the UI to work though theservicemethod I think that
> would be ideal.
>
> Best regards,
> Ron
>
> On Apr 17, 4:54 am, Daniel S <danielstamm...@googlemail.com> wrote:
>
>
>
>
>
>
>
> > Thank you for your answer.
>
> > On the tomcatserviceGUI you can activate "Allowserviceto interact
> > with desktop" only with a local user, and in this case all works
> > fine.
> > But we need to use another User for theservice, and then its
> > impossible to check the checkbox. Is there a workaround?
>
> > Kind regards
> > Daniel
>
> > On Apr 13, 10:07 pm, Fernando Cervera <fernandogcerv...@gmail.com>
> > wrote:
>
> > > In case that you are runningJenkinsas a windowsservice, you should
> > > either activate the checkbox "Allowserviceto interact with desktop" on
> > > theservice, or just run it from the console with "java -jarjenkins.war".
> > > The later option is what i'm using at this moment.
>
> > > Hope it helps.
>
> > > On Thursday, April 12, 2012 1:09:28 PM UTC-3, Daniel S wrote:
>
> > > > Hello,
>
> > > > we implemented a testautomation and it works locally very good, but we
> > > > want it run on our Server, too.
> > > > So we created ajenkinsbuild for the testautomation and we got
> > > > following error:
>
> > > > Could not start Selenium session: Failed to start new browser session:
> > > > Error while launching browser
>
> > > > Is it possible,that there are problems because it runs in a tomcat
> > > >serviceand so it doesn't have it's own "graphical interface"?

shivanshu sharma

unread,
Sep 18, 2017, 6:35:35 AM9/18/17
to Selenium Users
Hello All,
Why we need to setup jenkins using .war file in windows instead of .exe file?
Reply all
Reply to author
Forward
0 new messages