Search |
||
Hudson Selenium Grid PluginPosted by kohsuke on May 16, 2009 at 7:45 AM PDT
I've released the Hudson Selenium plugin, which instantly lets you deploy Selenium Grid on top of your existing Hudson cluster. By using this plugin, you can start using Selenium Grid without installing it on individual machines in the cluster manually. This is the latest addition to the family of plugins that let you reuse you Hudson cluster infrastructure for additional purposes. Once you install this plugin from the update center, Hudson master will become the Selenium Grid hub, the center of the Selenium Grid system. Similarly, each slave that you have in your cluster will now run Selenium RCs. The whole process happens completely automatically, without any additional configuration. To connect to this grid from your Selenium tests, create a DefaultSelenium instance by specifying the host name of your Hudson master, like this: new DefaultSelenium("hudson.mydomain", 4444, "*firefox", "http://site.that.iam.testing/");
By default, Selenium Grid randomly chooses a Selenium RC to carry out the execution, but this behavior makes it difficult to reliably start a platform dependent browser (like IE and Safari), that needs to be run on specific computers. As such, it's convenient to be able to specify the slave that runs the browser. To do this, Hudson Selenium Grid plugin extends the stock Selenium Grid by extending the browser identifier. Specifically, you can specify "label1&label2&...:browser" to tell Selenium Grid to start the specified browser on a slave that has all the given labels. For example, if your Windows slaves have the "windows" label, the browser identifier of "windows:*iexplore" would cause a Selenium RC on some Windows slave to start the IE. We are increasingly seeing tools like Hadoop and Selenium, which requires a cluster of computers to operate. Given the rise of multi-core systems, cloud computing, and other general shift for increased parallelism, I expect this trend to continue. Now, the problem of those tools is that it's harder to set them up and keep them going. One of the things I want to do with Hudson is to enable their deployments on the Hudson cluster. I think this is a convincing value proposition, given that Hudson byitself is pretty easy to install and maintain (even on a cluster), and that it already has an update center built-in. I intend to talk more about this in my JavaOne session, so please drop by! »
Related Topics >>
Java Tools Comments
Comments are listed in date ascending order (oldest first)
Submitted by mhicauber on Fri, 2009-07-10 05:59.
Hi there,
First of all congratulation for your great work.
I'm trying to setup selenium grid plugin for hudson.
When I try to startup my selenium slave, i get this message in the hudson console :
Connecting to XXX.XXX.XX.XX
Copying slave.jar
Starting the service
Waiting for the service to become ready
The service didn't respond. Perphaps it failed to launch?
Then if I have a glance at the event viewer console on my windows slave show me that stack :
Service cannot be started. System.ComponentModel.Win32Exception: Le fichier spécifié est introuvable
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at winsw.WrapperService.StartProcess(Process process, String arguments)
at winsw.WrapperService.OnStart(String[] args)
have you ever had a similar issue ?
Thank you,
Mathieu
Submitted by jpschewe on Fri, 2009-07-03 19:43.
How does the display get defined for the RCs? I suspect this is why it won't run for me.
Submitted by kohsuke on Fri, 2009-06-19 12:49.
I'll improve the plugin so that it checks the size of the cluster and if it's small, I'll have the master run a Selenium RC, too.
Submitted by kohsuke on Fri, 2009-06-19 13:09.
Turns out this requires a fix in the core. Hudson 1.312 should make the Seleinum plugin (and Hadoop plugin, too) use the master, too.
Submitted by pettys on Wed, 2009-06-17 15:58.
Hi there Kohsuke -- this is exactly what I'm looking for. Will this work if I just have one master Hudson node with no slaves? I installed the plugin and it appears to be running just fine. Selenium server appears to be running on that box as well. But clicking in Hudson on Selenium Grid shows, "No RCs have checked in yet. Have you started some slaves?", and I get a Server Error (500) when trying to connect to selenium on the hudson master machine. Maybe it wasn't designed to work on a master-only situation, or do I just have something configured wrong?
Thanks for any comments that come to mind,
Jason
Submitted by kohsuke on Wed, 2009-06-17 19:09.
Right, as it stands now, this plugin only starts RCs on slaves and never on the master. I thought the use case of Selenium Grid pretty much requires a multi-node set up. Are you just evaluating it (and felt it's more convenient if you can test-drive it just with the master), or are you really going to run this with the master-only set up?
Submitted by pettys on Wed, 2009-06-17 19:45.
Wow -- thanks for the fast response. Browsing through your posts I'm really impressed with what you've done with Hudson.
It was my intention to have the master-only build server also run the Selenium tests we have. I saw this selenium plugin for hudson and thought it might be a lot easier to use it rather than go through all the goo of getting selenium installed as a service directly -- I've looked through those tutorials and decided to look for an alternative.
If you have any other thoughts I'd be grateful, otherwise I'll look into either setting up a selenium service or else setting up slave and trying a regular grid.
Thanks again for these great ideas and plugins!
Jason
Submitted by joshkoenig on Thu, 2009-07-23 12:26.
Some notes for others looking to get rolling w/this AWESOME plugin. I'm a php guy, and will do some more substantive documentation at some point, but here are some choice tidbits:
The equivalent to DefaultSelenium for PHPUnit would be like this:
function setUp()
{
$this->setHost("hudson.economist.com");
$this->setPort(4444);
$this->setBrowser("selenium:*firefox /usr/lib/firefox-3.0.11/firefox");
$this->setBrowserUrl("http://www.yoursite.com/");
}
Note I am using the slave label "selenium" to designate a RC-ready node. Other things I had to do to get this working:
1) Add a bit to /etc/profile.d to set the $DISPLAY evn var to :0
2) Add an explicit path to firefox as you see in setBrowser
3) Logged in with the slave user and initialized a first vncserver on :0 to create the .Xauthority file
Next steps are getting better XML back and more scripting infrastructure around the job being run. This is good stuff!
Browser won't show up on the slave
Submitted by mhicauber on Mon, 2009-10-19 07:14.
Hi,
I managed to set up the plugin (well, indeed you did a great work there's not much to do !!). Now when I try to run a test, the browser doesn't show up on the slave machine. Also, the captures taken into the test will be all black, and the slenium 'type' command will return an 'element not found' exception. Is there some kind of 'background' mode or something that would make the browser invisible and could be the reason of those errors ? See below my hudson trace, everything seems to be OK on the hub side : 16:01:57.461 INFO - Command request: getNewBrowserSession[*chrome, http://www.google.fr, ] on session null 16:01:57.461 INFO - creating new remote session 16:01:57.461 INFO - Allocated session 8f6c341d82a04002921017c9204394a7 for http://www.google.fr, launching... 16:01:57.493 INFO - Preparing Firefox profile... 16:01:59.586 INFO - Launching Firefox... 16:02:01.461 INFO - Got result: OK,8f6c341d82a04002921017c9204394a7 on session 8f6c341d82a04002921017c9204394a7 16:02:01.477 INFO - Command request: type[q, bla bla bla] on session 8f6c341d82a04002921017c9204394a7 16:02:01.493 INFO - Got result: ERROR: Element q not found on session 8f6c341d82a04002921017c9204394a7 16:02:01.508 INFO - Command request: testComplete[, ] on session 8f6c341d82a04002921017c9204394a7 16:02:01.508 INFO - Killing Firefox... 16:02:01.633 INFO - Got result: OK on session 8f6c341d82a04002921017c9204394a7 |
||
|
|