Plugin Information
This plugin turns your Hudson cluster into a Selenium Grid cluster, so that you can utilize your heterogeneous Hudson clusters to carry out Selenium tests. This plugin is a turn-key solution — no additional installation nor configuration is necessary to make it work. The plugin installs Selenium Grid on all the slaves automatically and set up a grid on its own. Selenium Grid deployment on Hudson clusterThis plugin sets up Selenium Grid in the following way
Modification to Selenium GridWhen you run selenium tests in stand-alone Selenium, you specify the type of the browser in the constructor. new DefaultSelenium("hudson.mydomain", 4444, "*firefox", 'http://amazon.com'); As Selenium Grid describes here, this continues to work with Selenium Grid, but this doesn't really give you any control over where the test is run. It may run on your Windows slave, your Linux slave, or your Mac slave. Selenium Grid introduces a notion of environments in an attempt to fix this problem, but the design doesn't really scale well when each RC is capable of supporting multiple browsers. Hudson Selenium Grid extends the browser selector in Selenium in a different way. You can use labels you assigned on your slaves to select slaves that will run the browser. The syntax is "LABEL[&LABEL&...]:BROWSER". For example, suppose if you have labels like "linux", "solaris", "windows", "32bit", and "64bit". The following table shows a few example of what the browser value will mean:
The "BROWSER" portion is passed as-is to the selenium RC. For valid values, see this and this. ChangelogVersion 1.3 (2010 Jan 25)
Version 1.2
Version 1.0 (2009/4/26)
|

Comments (7)
Jun 26, 2009
Sylvain says:
Selenium server is bundled in plugins/selenium/WEB-INF/classes/hudson/plugins/se...Selenium server is bundled in plugins/selenium/WEB-INF/classes/hudson/plugins/selenium/selenium-grid.tgz.
This makes hard to change server implementation since you need to replace its JAR in this TGZ which is embedded in plugin dist: you must repeat this operation each time you updgrade Selenium plugin.
Any chance you make this easier by externalizing Selenium JARs in another directory ?
Anyway: great plugin
NB : I need Tellurium implementation of Selenium server
Aug 31
Dave Searle says:
Hi, I am having an issue with the delimiter that is used for selecting the RC. ...Hi,
I am having an issue with the delimiter that is used for selecting the RC. The browser string I specify is:
ff3.5:*custom c:/bin/firefox35/firefox.exe -profile c:/bin/firefox35/profiles/selenium
This is because I have Firefox 3.0 and 3.5 installed on the same machine but the plugin is tokenizing based on the colon. So it fails to launch as it does not strip out the label because there is more than one colon. Current work around is to use:
ff3.5:*custom /bin/firefox35/firefox.exe
which works (because it is all on C Drive) but does not give me a custom profile (if I remove the c: for the profile firefox does not start). Can this be changed to allow for windows (and unix) paths in the string. Perhaps the delimiter could be something different?
Oct 21
Volker says:
For those who need to change the grid configuration: It seems that the plugin u...For those who need to change the grid configuration:
It seems that the plugin uses the grid_configuration.yml from within the /var/hudson/selenium-grid/lib/selenium-grid-hub-standalone-1.0.4.jar and not the one located in /var/hudson/selenium-grid. Maybe you have to change the selenium sources to make it look in the correct folder / location.
see gridConfiguration() in https://svn.openqa.org/svn/selenium-grid/trunk/hub/src/main/java/com/thoughtworks/selenium/grid/hub/HubRegistry.java
and https://svn.openqa.org/svn/selenium-grid/trunk/infrastructure/core/src/main/com/thoughtworks/selenium/grid/configuration/ResourceLocator.java
Modifying the grid_configuration.yml and putting it into the .jar works for me.
Oct 29
Volker says:
After having a look at the plugin sources I found that the grid-configuration fi...After having a look at the plugin sources I found that the grid-configuration file is only read for printing the configuration to the log, but has no other effect. In contrast, the grid chooses only those environments that follow the syntax LABEL:BROWSER, where BROWSER must not contain any colon.
Since I was not able to compile the plugin, it would be great if someone else could verify that the following fix works:
change the hudson.plugins.selenium.HudsonEnvironmentManager.environment(String) to:
Nov 17
Mathieu HICAUBER says:
Hi, I've successfully deployed selenium grid on a Hudson 1.329 - everything is f...Hi,
I've successfully deployed selenium grid on a Hudson 1.329 - everything is fine.
However I intended to do the same work on a 1.309, and I can't get it to work : installation of the plugin show no errors :
INFO: Starting the installation of Selenium Plugin on behalf of mhicauber
17 nov. 2009 09:48:37 hudson.model.UpdateCenter$UpdateCenterConfiguration download
INFO: Downloading Selenium Plugin
17 nov. 2009 09:48:48 hudson.diagnosis.HudsonHomeDiskUsageChecker doRun
INFO: Not on JDK6. Cannot monitor HUDSON_HOME disk usage
17 nov. 2009 09:50:39 hudson.model.UpdateCenter$DownloadJob run
INFO: Installation successful: Selenium Plugin
But when I restart the hudson server I get the following error :
17 nov. 2009 09:52:09 hudson.PluginManager
GRAVE: Failed to load a plug-in selenium
hudson.util.IOException2: Failed to initialize
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:224)
at hudson.PluginManager.(PluginManager.java:154)
at hudson.model.Hudson.(Hudson.java:549)
at hudson.WebAppMain$2.run(WebAppMain.java:191)
Caused by: hudson.util.IOException2: Failed to extract input stream
at hudson.FilePath.readFromTar(FilePath.java:1386)
at hudson.FilePath.access$200(FilePath.java:154)
at hudson.FilePath$7.invoke(FilePath.java:475)
at hudson.FilePath$7.invoke(FilePath.java:473)
at hudson.FilePath.act(FilePath.java:635)
at hudson.FilePath.untarFrom(FilePath.java:473)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:541)
at hudson.plugins.selenium.PluginImpl.install(PluginImpl.java:207)
at hudson.plugins.selenium.PluginImpl.createSeleniumGridVM(PluginImpl.java:185)
at hudson.plugins.selenium.PluginImpl.start(PluginImpl.java:78)
at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:232)
at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:221)
... 3 more
Caused by: java.io.FileNotFoundException: /root/.hudson/selenium-grid/./Capfile (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:131)
at hudson.FilePath.readFromTar(FilePath.java:1369)
... 14 more
Indeed, Hudson is right : the selenium-grid directory doesn't exist in ~/.hudson
Any idea ?
Thank you,
Mathieu.
Feb 03
Peter Gengler says:
Hi, First, totally dig the idea of this plugin, it seems like it will work wel...Hi,
First, totally dig the idea of this plugin, it seems like it will work well once I get it all happily configured; however, I am having issues trying to get nodes configured, both windows and linux (ubuntu). For some detail I'm running Hudson 1.343 and the 1.3 version of the plugin (which I believe are the most recent). The server/master is running ubuntu 8.04.2 and is proxied through Apache (i.e. so i can do http://hudson.domain instead of http://hudson.domain:8080). I've split my questions into two, one about Linux and one about Windows as they're a little long and I figured that'd be easier to track.
I'll start with linux since it goes farther into the process. I tried the JNLP route (since that was what I tried with the Windows node, which I had done first) but that didn't work at all, so I moved to ssh which seemed cooler for linux anyways (so that it would configure from the master vs. the slave). At first when adding the nodes in Hudson they would get all setup as hudson nodes but hit an exception when trying to do the selenium stuff. Unfortunately I forgot to capture the stack trace. However, this was with Hudson 1.342 and when I upgraded to 1.343 it started successfully setting up the selenium part too; not sure if this was 1.343 or the Hudson restart or what. At any rate the slave is there, its listed in http://hudson.domain:4444/console and if i run against that URL with a test it will try to go; however, it can't run any tests. When I try to run one it fails opening the browser (Firefox 3.0) with this error:
I've also tried directly going to the port exposed by the slave and I get the same result. As another experiment I downloaded the 1.04 selenium grid distribution (should be the same one that is used by the 1.3version of the plugin) and started that with rake rc:start and the appropriate options and when I use that it does correctly open a browser. The startup commands for each are different, altough I can't figure out what is making the difference; here is what the java startup command looks like for each
Selenium RC via Hudson plugin (non-working)
Starting Selenium RC[selenium-grid] $ /usr/lib/jvm/java-6-sun-1.6.0.16/jre/bin/java -cp /tmp/hudson/slave.jar hudson.remoting.Launcher -cp /tmp/hudson/selenium-grid/lib/commons-httpclient-3.1.jar:/tmp/hudson/selenium-grid/lib/selenium-grid-remote-control-1.0.4.jar:/tmp/hudson/selenium-grid/vendor/selenium-server-1.0.1.jar -connectTo localhost:48786 channel started Starting Selenium RC with [-host, slave.domain, -port, 47949, -env, /firefox/slave/linux/, -hubURL, http://hudson.domain:4444/, -log, selenium.debug.log, -debug]Selenium RC via Rake (working)
The only perhaps meaningful difference I can see is Hudson using selenium-grid-remote-control-1.0.4.jar whereas the rake command uses selenium-grid-remote-control-standalone-1.0.4.jar. I'm still pretty confused about what all the various JAR files are that are included with Selenium Grid, so I don't know which one is more right or what difference they'd have.Sorry about the lenght, wanted to make sure I was thorough. If anyone has ideas or suggestions please let me know.
Thanks,
\Peter
Feb 03
Peter Gengler says:
My windows issue has significantly less information. I'm trying to get a w...My windows issue has significantly less information. I'm trying to get a windows 7 client running. I've turned off Firewall to make sure that isn't blocking anything and I verified that the hudson master can ping the slave. Again in this scenario Hudson adds the node just fine, deploys out maven.jar and whatever else it does, but then I get that dreaded
I've seen that on other threads but they all seemed to be having issues with the pinging/accessiblity, but I don't believe that is my issue here, or at least not in the same way. Unfortunately, I'm unclear what other debugging I can do; is there any additional insight on how Hudson's plugin is trying to get the host name and how to pass that through to Selenium correctly?
My other problem on Windows is that I'm using the JNLP method so I'm starting up from the client; that registers fine (aside from the issue above) but when I try to install as a window service from the menu item it gives me a permissions error. Anything special I need to be doing here? Also, I'm presuming installing as a service and running on startup will make this slave auto-connect to the hub when it boots is that correct? Is there a more preferred way to get Windows clients on board? I've seen varying information on what method to so, I'd like to use the most support method that will allow me to run browser tests (i.e. need a GUI) on the Windows RC; obviously being able to manage from Hudson (ala the SSH of the Linux clients) is preferred, but not at the expense of an extremely complicated setup.
Thanks,
\Peter