Sunday, January 26, 2014

Run Selenium web-driver test in remote machine



This is the step by step tutorial for automating web application using selenium web-driver (aka Selenium 2.0) in remote machine. Hope you are familiar with Ruby language and web-driver commands. Also make sure you have Java, Ruby web-driver and Firefox installed.
For better understanding let’s say there are two machines “hub” (IP: 192.168.10.10) and “remote” (IP: 192.168.10.11). This example is for default settings. You can also s run the stand alone server in different ports


For starting Hub:
Open command prompt in “hub” (IP: 192.168.10.10) machine and run selenium stand alone server by following command:
java –jar selenium-stadalone-server.jar –role hub

For starting node:
Open command prompt in “remote” (IP: 192.168.10.11) machine and run selenium stand alone server by following command:
java –jar selenium-stadalone-server.jar –role node –hub http://192.168.10.10:4444/grid/register

Launch test in hub machine:



Watch your remote machine; firefox browser will open, will browse google.com and will search for “Test”. Finally you will see a screenshot in your hub machine.
 

No comments:

Post a Comment