Tag Archives: Selenium

Install SeleniumServer as a Windows service on Windows Server 2003

In this tutorial I’m going to show how you can set up a Selenium Server as a service under Windows Server 2003. More information about Selenium testing is found here: SeleniumHQ.
One thing to point out is that you can use this way to make almost any program into a service on the Windows platform

Software needed:

  • Windows Server 2003 Resource Kit Tools. You can find it here (the programs we are going to use for this tutorial is instsrv.exe and srvany.exe)
  • Java runtime environment. You can find this here (only needed for the Selenium Server)

The first thing to do is to install a generic service:

  1. Open the command line (type ‘cmd‘ in the run menu)
  2. Navigate to the rktools folder (where you installed the Windows Server 2003 Resource Kit Tools). Usually this is in “c:\program files\rktools
  3. Type: ‘instsrv.exe SeleniumServer “c:\program files\rktools\srvany.exe” -a MACHINEuser -p password

Explanations:

SeleniumServer” is the name of the service (how it is displayed in Services.msc)

c:\program files\rtools\srvany.exe” path to srvany.exe

-a MACHINEuser” the user that will run the service. This kan be changed later*. Use admin at this point to save the rights problems for later ;). (* to change the user of a service: right click it and choose Preferences/login)

-p password” the user password (for the user that runs the service)

The generic service is now ready. Time to attach a program to it:

Starta regedit.exe (type ‘regexp’ in Run menu):

  1. Find the key: HKEY_LOCAL_MACHINE\SYSTEM\Current\ControlSetServices\SeleniumServer
  2. Create a new subkey called “Parameters
  3. Create a new string value (in “Parameters“) called “Application” and set it to the full path of java.exe. For me this was: “c:\Program Files\Java\jre1.5.0_04\bin\java.exe
  4. Create another string value (in “Parameters“) called “AppDirectory” and set it to the folder where the selenium server are. For me this was: “c:\Program Files\SeleniumServer
  5. Create another string value (also in “Parameters“) called “AppParameters” and set it to: -jar seleniumserver.jar (theses are the start parameters for the java.exe)

Now you are ready to start the new service. One way is to type “net start SeleniumServer” on the command line or you can open Services.msc, right click the service and choose ‘Start’

Problems? Check this first:

  1. Check the user rights – does the user have all the rights necessary to run the service/program
  2. Check that the port that is being used is open. Standard port is: 4444
  3. Check the firewall so that it do not stop the traffic on the specific port
  4. Google it! 😉