Wednesday 17 June 2015

Selenium grid(Practically worked) Notes.

Selenium GRID:
It is nothing but executing the test scripts remotly on other computers which is in other words called as nodes.

Selenium grid mainly consists of 3 parts.
1) HUB
2) NODES
3) Script Runner.

--> HUB:
              Hub acts like a master which intern takes the control of all the nodes.

--> NODES:
              Node is an another computer which is otherwise called as slaves. This nodes will take in the request which ever sent by the hub and processes it.

--> Script Runner:
              Script Runner is also a computer where we will run our WebDriver(JAVA) code. The script runner will send a request to hub for the execution of a perticular script. The hub will redirect the request sent by the script runner to the respectiive nodes. The nodes will automate the respective test script which ever sent by the script runner.


HOW TO MAKE A COMPUTER ACT AS A HUB??

Goto command prompt --> Type the following command

java -jar "path of the selenium RC JAR" -role hub -port 1111

HOW TO MAKE OTHER COMPUTER ACT AS A NODE??

goto command prompt--> type the following,

java -Dwebdriver.chrome.driver="path of chromeDriver.exe file" -Dwebdriver.ie.driver="path of IEDriver.exe file" -jar "path of Selenium RC JAR file" -role node -hub http://<IP ADDRESS OF HUB COMPUTER>:PORT NUMBER(1111)/grid/register -browser browserName="chrome" -browser browserName="internet explorer" -port 5511

NOTE: We can type the above command in multiple computer. For example you have 3 computers and you want to make that 3 computers to act like nodes. Type the above command on all the 3 computers.

HOW TO WRITE THE TEST SCRIPT??



HOW TO OPEN DIFFERENT BROWSERS ON DIFFERENT NODES:

This can be done by using .XML file.. And including <parameter> tag

No comments:

Post a Comment