Working with Selenium-Grid
1. Download selenium Grid. And extract files any location. Mostly in C:selenium
2. Install latest JRE.
3. Download ANT. Extract files in C:Ant.
– Set environment variable ANT_HOME as
– Go to the properties menu of MyComputer
– Go to the advance menu and click on ‘Environment Variable’
– Click on new and Enter value ‘ANT_HOME’ variable with your folder value where you have installed Ant.
– Now set the path variable as
Edit value and add location of your antbin folder
4. Now go to the selenium-grid folder from command prompt and launch-hub as follow:
Hub will start on port no 4444 as follow:
5. Now start remote server from new terminal from same selenium-grid folder as follow
It will start as follow:
6. Now in browser go to the hub location by http://localhost:4444/console.
7. To start more remote server enter
ant -Dport=5556 launch-remote-control
ant -Dport=5557 launch-remote-control
ant -Dport=5558 launch-remote-control
8. Now the hub on browser will show as
Available Remote Controls
Host Port Environment
localhost 5555 *firefox
localhost 5556 *firefox
localhost 5557 *firefox
localhost 5558 *firefox
Note: The total run time is directly proportional to the number of available remote controls. So don’t start more controls if not necessary.
9. Run the hub
This setup illustrates that you can run the hub and the remote controls on arbitrary machines. When you do so though, you need to provide a lot more information when launching a remote control. You need to launch it with:
ant -Dport=<port> -Dhost=<hostname> -DhubURL=<hub url> launch-remote-control
port Port that the remote control will be listening at. Must be unique on the machine the remote control runs on. hostname Hostname or IP address of the machine the remote control runs on. Must be visible from the Hub machine. Note: this information could be inferred as it is always referring to the machine the remote control runs on. It might not be required in future versions of the Selenium Grid. hub url Which hub the remote control should register/unregister to. If the hub is running on hostname my.hub.com, this URL will be http://my.hub.com:4444
10. Now to run a test open new cmd prompt and go the test folder.
11. This will start the test.