Running Selenium GRID as a Windows service with Ant
In this post, I'll run selenium GRID with 3 remote controls bound to it i.e.
Selenium Grid on MS Windows ->Selenium Internet Explorer Remote Control ->Selenium Firefox Remote Control ->Selenium Chrome Remote Control
Prerequisites:
Windows Server 2003 Resource Kit Tools Selenium GRID (I'll go with selenium-server-Grid-1.0.8) Apache Ant 1.7.* (how you install this is up to you) JDK 6*
Create a folder named GRID inside your Selenium folder on your C drive and copy entire content of your downloaded selenium grid zip file into newly created folder i.e.
C:\Selenium\GRID\*
in command prompt change directory to your windows resource kit i.e.
C:\Program Files (x86)\Windows Resource Kits\Tools
Install 4 windows services for GRID, IE remote control,Firefox remote control and Chrome remote i.e.
NB: Ideally these services should run as Local System with the interact with desktop checkbox checked
instsrv.exe "Selenium GRID" "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" instsrv.exe "Selenium IE" "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" instsrv.exe "Selenium Chrome" "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" instsrv.exe "Selenium Firefox" "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
Save the text below as a registry file then run the reg file to merge .i.e.
Note: back up your windows registry before merging any registry file
reg_selenium_grid.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Selenium GRID Server\Parameters] "Application"="C:\\ant\\bin\\ant.bat" "AppDirectory"="C:\\Selenium\\GRID" "AppParameters"="launch-hub" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Selenium IE\Parameters] "Application"="C:\\ant\\bin\\ant.bat" "AppDirectory"="C:\\Selenium\\GRID" "AppParameters"="-Dport=5556 -Denvironment=*iehta launch-remote-control" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Selenium Chrome\Parameters] "Application"="C:\\ant\\bin\\ant.bat" "AppDirectory"="C:\\Selenium\\GRID" "AppParameters"="-Dport=5557 -Denvironment=*googlechrome launch-remote-control" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Selenium Firefox\Parameters] "Application"="C:\\ant\\bin\\ant.bat" "AppDirectory"="C:\\Selenium\\GRID" "AppParameters"="-Dport=5555 -Denvironment=*firefox launch-remote-control"
test grid is up and running:
on your browser, visit:
http://localhost:4444/console
you should see a Selenium Grid Hub page with the following Remote Controls available
Host Port Environment localhost 5556 *iehta localhost 5555 *firefox localhost 5557 *googlechrome
Viola! We have Selenium GRID running as a service with 3 remotes bound to it:













