Selenium has various projects that can be combined with each other to create a robust testing environment.

  • Selenium IDE: a Firefox add-on to record and playback tests in Firefox.
  • Selenium Remote Control: a client/server system to control web browsers locally or on other computers, using almost any programming language and testing framework.
  • Selenium Grid: transparently distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites. In-browser tests are inherently slow, but since commodity hardware is insanely cheap nowadays there is no excuse for not running all these tests in parallel on multiple machines and dramatically speeding up your feedback cycle. .
  • Selenium Core: JavaScript-based testing system.

Also there are Selenium projects specifically for Rails, Ruby & Eclipse!

Today I will show you how to make run some components of Selenium as Windows Services. I am using a Selenium HUB and 4 Selenium RC running all on the same server (while not recommended for performance reasons, it is the easiest setup)

In this small how to I provide you at the end of the article a ready to use Selenium Grid 0.7 zip file

Running selenium HUB as an NT service

The Selenium Hub is in charge of

  • Allocating a Selenium Remote Control to a specific test (transparently)
  • Limiting the number of concurrent test runs on each Remote Control
  • Shielding the tests from the actual grid infrastructure

Selenium Grid Setup

  1. Download and unzip Selenium Grid.
  2. If you don't have it already, download and install the JDK 
  3. Download Java Service Wrapper (Windows x86 Community Edition) and unzip it.
  4. Create these folders in the Selenium Grid folder: *logs*, *conf*, *bin*. so it look like
Before After




Copy/rename files from the JSW folder to the Selenium Grid folder:

  • \src\conf\ to \conf\wrapper.conf
  • \src\bin\ to \bin\SeleniumGrid.bat
  • \src\bin\ to \bin\InstallSeleniumGrid-NT.bat
  • \src\bin\ \bin\UninstallSeleniumGrid-NT.bat
  • \bin\wrapper.exe to \bin\wrapper.exe
  • \lib\wrapper.dll to \lib\wrapper.dll
  • \lib\wrapper.jar to \lib\wrapper.jar

Now edit the file \conf\wrapper.conf

Set the location of Java.exe by editing the line

And making sure to not quote the path even if it has spaces in it

Replace the  key with these three lines:

Change key" to:

And finally set up the names/display names for the service:

wrapper.console.title=Selenium Grid Hub
wrapper.ntservice.displayname=Selenium Grid Hub
wrapper.ntservice.description=Central control server for Selenium Grid

Test your configuration by running the \bin\SeleniumGrid.bat file.

If it works, you should see Selenium Grid Hub running in the console - one of the the last lines will likely say something about Jetty and you may see some of the Selenium Grid configuration fly past as it's starting up. You can shut it down by pressing Ctrl+C.

If it's not working, you'll probably see error messages about how the JVM wasn't found (meaning the path to Java is no good) or some other configuration problem. Or the batch file might run and close immediately.

Once it's running with the SeleniumGrid.bat file, you can install the service by running the InstallSeleniumGrid-NT.bat file.

To start the service, you can use the command line (net start selenium-grid-hub) or the GUI (Start->Administrative Tools->Services).

Running multiple selenium RC as NT services

Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.

Selenium RC comes in two parts. 

  1. A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them.
  2. Client libraries for your favorite computer language.

Following the same idea, with only some minor changes due to the way selenium RC are started in wrapper.conf

First install all browsers or only some that you would like to support:


Google Chrome, Mozilla Firefox, Apple Safari to name a few, Dont forget that you MUST put them in windows environment variable PATH, so Selenium RC will be able to start them.

Then create for each browser you would like to support the following directory structure

Before After




Move files around from previous example, so that it look like

│       InstallRemoteControl-NT.bat
│       RemoteControl.bat
│       UninstallRemoteControl-NT.bat
│       wrapper.exe

│       wrapper.conf


Here are the settings of wrapper.conf for Google chrome that you need to change across the file, Change all values according to your setup.


# Java Classpath (include wrapper.jar) Add class path elements as # needed starting from 1 # Application parameters. Add parameters as needed starting from 1 "5558" "localhost" "http://localhost:4444" "*googlechrome" "30" "..\logs\chrome.log" "15" # Name of the service # Display name of the service wrapper.displayname=selenium-chrome # Description of the service wrapper.description=selenium-chrome # Java Library Path (location of Wrapper.DLL or

You get the idea, for every browser, you have to repeat the same procedure. The only difficult point not documented anywhere is that you can not run the browser with the windows local account, you need to use the windows user that has installed the browser or at least has enough right to create a new browser profile. Failing to do it, will throw a null pointer exception while trying to get a new Google Chrome browser session.

So you must have a valid user under these 2 keys, you can choose what you want


Once it's running with the RemoteControl.bat file, you can install the service by running the InstallRemoteControl-NT.bat file.

To start the service, you can use the command line (net start selenium-chrome) or the GUI (Start->Administrative Tools->Services).

Anyway head to the download section and use a ready to use package


How to give the selenium user the permission to "Start a session as a service".

Thanks to Eric Bouchut for submission

You need to give the selenium user the permission to start the session as a service, If you don’t do this, the service won't start at least on Windows XP/SP 3.
Here it is.
"For the service to start as the selenium user, you need to  give the selenium user the permission to "start a session as a service", as so:

  • Open the Control Panel
  • Click  "Administration Tools"
  • Click "Local Security Settings" (my attempt to translate "Stratégie de Sécurité Locale" in English)
    • In "Local Policies / User Rights Assignment"
    • Double click "Open a session as a service"
      • add the selenium user to the list


Original version of if you want to compare the changes i’ve made.

Ready to use Selenium-Grid 1.0.7 with all the above scripts configured, all the above in one file (22MB)

Happy Integration Testing with Selenium!

You might like also

Display the short GIT version hash as build identifier in TeamCity
TeamCity is a Continuous integration and build management server from JetBrains. As the first build step, create a custom script that reads %build.number%, and uses service messages to append the short GIT hash programmatically. Here’s an example using a bash script pasted right into the TeamCity GUI (Runner type: Command Line, Run: Custom Script): GIT_HASH=%build.vcs.number% GIT_HASH_SHORT=$ echo "##teamcity[buildNumber '#$']"   …
2181 Days ago
Latest JetBRAINS Teamcity 5 plugin for the Tux Droid
I did refresh the tuxdroid teamcity plugin project a bit on request to Jasper Moltke Nygaard (Danmark ) TeamCity is a #Java-based build management and continuous integration server from JetBrains, creators of IntelliJ IDEA and ReSharper With this plugin you can notify your Tux Droid with your TeamCity build results. After login you can find the new notificator Tux Droid in your notification settings. You need your Tux Droid server IP and port to connect your Tux to TeamCity. After …
3503 Days ago
Install Atlassian Confluence in 15 minutes
In this small post, you will learn how to install Atlassian Confluence in no more than 15 minutes. It do not replace the online installations manual (The Confluence Installation Guide is for people who are installing Confluence for the first time. Check the requirements and supported platforms, then download and install Confluence), but mainly complement it, with some of the best #Linux practices (ADDED points).         How to install Atlassian Confluence in 15 minutes Create user and …
3641 Days ago
No Thumbnail was found
Amazon EC2 and Virtual Agents Take avdantage of cloud computing with TeamCity by putting Build Agents on Amazon EC2. After your Build Agents' AMIs (Amazon Machine Images) are registered, the TeamCity server will account for those virtual machines in its build scheduling and will automatically do a suspend/resume job on them, based on the load and build queue status. Better Support for #Maven Version 5.0 has many #Maven support improvements under the hood. These include the creation of #Maven-based build …
3702 Days ago
Update JetBrains TeamCity in one click
  A small script developed to upgrade TeamCity with no or less effort! a very simple script, easily extensible. “TeamCity is a continuous integration and build management system. With TeamCity, you can set up a build server within minutes and enjoy out of the box continuous unit testing, code quality analysis, and early reporting on build problems — even without leaving your favorite IDE. TeamCity offers a gentle learning curve, so you can quickly improve your release management practices by …
3829 Days ago
Adding Google analytics to Atlassian Bamboo
As I found no better tutorial on Internet, here is a very very short how to add Google analytics to Atlassian Bamboo, it require a bit of hacking, and these kind of changes will be lost after each upgrade of Bamboo.. Edit the file webapps/ROOT/start.ftl Now put the usual code you get after creating a new analytics profile just before the </body> …
3917 Days ago
Continuous integration server Bamboo up and running
My Bamboo continuous integration server is now fully functional and available at       Remember Atlassian is providing free license for Open Source Projects: Atlassian supports and believes in the Open Source movement - Bamboo utilizes a number of good Open Source components, and Atlassian developers are committers on a large number of Open Source projects. To give back to the open source community (and hopefully improve the quality of those projects!), Bamboo is free for any Open …
3920 Days ago
TeamCity 4.5 up and running
Today JetBrains announces the public availability of TeamCity 4.5, it's award-winning distributed build management and continuous integration tool. With TeamCity, you can set up a build server for your projects within minutes and enjoy out of the box continuous unit testing, code quality analysis, and early reporting on build problems - even without leaving your favorite IDE. TeamCity offers a gentle learning curve, so you can quickly improve your release management practices by gradually adopting its advanced features and capabilities. …
3923 Days ago
phpUnderControl - Continuous Integration for PHP
More screen shots here phpUnderControl is an add-on application for the continuous integration tool CruiseControl, which integrates some of the best PHP development tools. This project aims to make your first steps with CruiseControl and PHP as easy as possible. Therefore phpUnderControl comes with a command line tool that performs all modifications to an existing CruiseControl installation. My objective is to be able to set up this server and provide you all an access to the build result for my …
4290 Days ago
Record testcases with Selenium IDE
Selenium is a test tool for web applications. Selenium tests run directly in a browser, just like real users do. It runs in Internet Explorer, Mozilla and Firefox on Windows, #Linux, and Macintosh, Safari on the Mac.  They have plans to target Safari on the iPhone in some months. The tool is free and available under Apache 2.0. Install the firefox plugin, note the latest version work only in Firefox 2.0 not in 3.0Beta! Install also XPather another Firefox extension, …
4302 Days ago