Jenkins configuration and selenium Grid

612 views
Skip to first unread message

steliosP

unread,
May 18, 2015, 9:55:26 AM5/18/15
to jenkins...@googlegroups.com
Hello guys, I am trying to set up Jenkins with selenium grid.
I have downloaded selenium plugin, and when I start the nodes, I can see them in Jenkin's selenium grid tab.
However, whenI try to build my project, nothing happens, because jenkins doesn't find any connected nodes.It's the same message when you're not running in grid, and no slaves are connected:
#361 (pending—Waiting for next available executor)

Some info regarding the project I am building:
A maven project, that pulls the latest from git, and then a parametrized build happens, that has the parameter
-Dsuite.Files=testSuite.xml

so only a specific testSuite is going to run

Any solution to my problem?

steliosP

unread,
May 21, 2015, 3:11:50 PM5/21/15
to jenkins...@googlegroups.com
Any Selenium Grid plugin users around?

Richard Lavoie

unread,
Jun 8, 2015, 8:28:28 PM6/8/15
to jenkins...@googlegroups.com
I don't know how you are trying to connect to the nodes, but the plugin only starts the hub and uses the salevss to start selenium slaves on to use the browser from the slaves. I doesn't start build on the right "nodes" according to selenium capabilities or suite files.

What you would do is in your trst code, connect your remote drivers to the jenkins master address to delegate the browser calls to the right selenium capabilitu for each tests.

Hope that helps,

Richard Lavoie
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/345ae109-55d3-462a-b7ba-1cb581d4cf2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

steliosP

unread,
Sep 16, 2015, 7:59:00 AM9/16/15
to Jenkins Users
Hello Richard.
The nodes are connected to jenkins hub, and are you can see them in selenium grid hub management tab.
But my question remains: how you can build a project in jenkins, and make it run on nodes?When upon pressing build you get :(pending—Waiting for next available executor)

Richard Lavoie

unread,
Sep 16, 2015, 10:03:42 AM9/16/15
to jenkins...@googlegroups.com
Hi,

The selenium plugin was never meant to make a build run on a particular node depending on browser capabilities.

What this plugin does is use your slaves as "browser providers" so that you can reuse your "sleeping" nodes.

 For example, let's say I have 2 nodes with matching selenium configurations, A and B, A being a windows machine that has IE and B an ubuntu desktop machine with Firefox. You launch a build and it goes on machine A. As part of your test, you need to test some code on IE. You create a new remote driver object, connecting to jenkins hub and requesting an IE session. Lucky you it's the same machine you are currently building on. IE gets started on machine A and you interact with it fir the said test. Now in another test you need to perform code in Firefox. You create a remote webdriver object, connecting to jenkins hub and request a firefox object. The browser is now launched on machine B but your build is still running on machine A.

The node where your build runs is independant of the test session you will need in your tests. To make your "build" run on a given node, you need to use other mechanism (like labels for instance) because the selenium plugin only use slaves as "browser providers". It is not a "build redirector" that makes projects needing selenium run on hosts that has selenium matching configurations.

Now if you have free nodes and the build doesn't want to run on them, the problem is elsewhere than in the selenium plugin. If jenkins itself isn't connected to the slave normally, there is something definitely wrong. The fact that the node is connected to the hub jenkins is hosting is also independant of jenkins being directly connected to this slave and be able to send jobs to it.

Richard Lavoie

steliosP

unread,
Sep 22, 2015, 11:04:05 AM9/22/15
to Jenkins Users
Hello RIchard,
What you describe is totally understandable.
Let me explain you my problem a bit.
I want to use Jenkins not only as a selenium grid host, but also as a CI server.
Let's say that from gird point of view, we are ok, since the slaves can be viewed in the selenium grid configuration tab.
Let's have the case where I am building a parametrized maven project,via Jenkins,
mvn -update-snapshots clean install -Dsuite.Files=blabla.xml etc

where blabla.xml is testng suite file, where information for running the tests through a grid are inside there, along with the test classes for execution
When building this project, jenkins need a slave executor to run, and ignores grid configuration.
But if I run the same command in cmd in my pc(meaning using the hub that is hosted in jenkins server), everything is ok.

Hope I shed some more light on the problem I am experiencing.

Thanks,

Stelios
Reply all
Reply to author
Forward
0 new messages