Selenium does off Selenium RC, which combined with nUnit allows for this in a variety of programming languages. The problem here, is that the server is a jar file, and I wanted it running as a windows service on our build server.
Anyway, I found a great article on tacktech.com that shows how to run just about anything as a windows service - and I successfully used that article to get Selenium RC running as windows service on our build server. Here are the steps:
- Install the latest Java runtime if you don't have it installed already
- Install the Selenium server (e.g. C:\Selenium\selenium-server-1.0.1
- Download srvany.exe and instsrv.exe (these are part of the Microsoft Windows Resource Kit - you will need to download the correct version for your OS) and copy these files to a location on your server (e.g. C:\reskit)
- Browse to this folder, and type: instsrv "Selenium RC" "C:\reskit\srvany.exe" - this will create the windows service named "Selenium RC", which will now be installed as a Windows service, although it won't start up yet
- Open up regedit, and browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Selenium RC
- Right-click "Selenium RC" in the tree, and click New - Key, and add a key called "Parameters"
- Open Parameters, and create a new string value called "Application"
- Add the following to the data value for the new string value: "C:\Program Files (x86)\Java\jre6\bin\java.exe" -jar "C:\Selenium\selenium-server-1.0.1\selenium-server.jar", substituting paths to the java exe and the selenium server jar file where appropriate
- Load up the windows services console (services.msc) and start the service
Thanks, this is very handy.
ReplyDeleteI'd written a similar article recently:
ReplyDeletehttp://unintelligible.org/blog/2009/07/28/installing-selenium-rc-as-a-windows-service
I've followed those steps. The service seems to be running but, when I trigger one of my Selenium tests from my Test Hub application the page just keeps saying Loading.
ReplyDeleteIf I stop it it throws an error so it seems like it is running but it doesnt seem to do anything.
I've also tried running it via the command line using the same command in the Application parameter and it works this way.
Do you have any ideas?