
To accomplish this you will need
1) a Red Hat or CentOS system, I'm using CentOS 5.4
2) Ant 1.7.x
3) JDK version 6
5) Firefox to demo an test setup
The following tutorial shows how to configure Selenium-RC on a single system
[root@cu003 java]# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)
[root@cu003 tmp]# unzip apache-ant-1.7.1-bin.zip
[root@cu003 tmp]# mv apache-ant-1.7.1 /usr/local
export PATH=$PATH:/usr/local/apache-ant-1.7.1/bin
[root@cu003 apache-ant-1.7.1]# ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
[root@cu003 tmp]# unzip selenium-grid-1.0.8-bin.zip
[root@cu003 tmp]# mv selenium-grid-1.0.8 /usr/local
[root@cu003 tmp]# cd /usr/local/selenium-grid-1.0.8/
[root@cu003 selenium-grid-1.0.8]# ant sanity-check
Buildfile: build.xml
sanity-check:
[echo] Apache Ant version 1.7.1 compiled on June 27 2008
[echo] Java 1.6
[echo]
[echo] ********************************************************************
[echo] Congratulations, your setup looks good. Have fun with Selenium Grid!
[echo] ********************************************************************
[echo]
[echo] You can launch a hub by running 'ant launch-hub'
[echo] You can launch a a remote control with 'ant -Dport=4444 launch-remote-control'
BUILD SUCCESSFUL
Total time: 1 second
Go to the selenium distribution directory and launch in a new terminal:
[root@cu003 selenium-grid-1.0.8]# ant launch-hub
Buildfile: build.xml
launch-hub:
[java] Nov 13, 2010 3:03:31 PM com.thoughtworks.selenium.grid.hub.HubRegistry gridConfiguration
[java] INFO: Loaded grid configuration:
[java] ---
[java] hub:
[java] environments:
[java] -
[java] browser: "*firefox"
[java] name: Firefox on Windows
Check out that the Hub is running by looking at its console in a browser
In a new terminal on the same machine, launch:
[root@cu003 selenium-grid-1.0.8]# ant launch-remote-control
Buildfile: build.xml
launch-remote-control:
[java] Nov 13, 2010 3:08:42 PM com.thoughtworks.selenium.grid.remotecontrol.RegistrationRequest execute
[java] INFO: Registering to http://localhost:4444/registration-manager/register
[java] Nov 13, 2010 3:08:43 PM com.thoughtworks.selenium.grid.remotecontrol.SelfRegisteringRemoteControl logStartingMessages
In a browser, go back to the Hub’s console at http://localhost:4444/console. Now you should have one remote control listed as available. You should see something like:

In a new terminal
ant run-demo-in-sequence
Four Selenium tests will then run in sequence against your remote control. Take note of how long it took to run the whole test suite – this will give you a baseline. To be honest, there is nothing really exciting about this part of the demo. You can achieve exactly the same thing with a traditional remote control. This is just to get you started, since the whole point of the Selenium grid is to run tests in parallel. That’s exactly what we are going to do next.
Watch a demo to see it in action
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer