Sunday, 8 March 2015

Selenium Grid

What is Selenium Grid?


Selenium Grid is a part of the Selenium Suite that specializes on running multiple tests across different browsers, operating systems, and machines in parallel.


What is a Hub and Node?

The Hub

  • The hub is the central point where you load your tests into.
  • There should only be one hub in a grid.
  • The hub is launched only on a single machine, say, a computer whose OS is Windows 7 and whose browser is IE.
  • The machine containing the hub is where the tests will be run, but you will see the browser being automated on the node.

The Nodes

  • Nodes are the Selenium instances that will execute the tests that you loaded on the hub.
  • There can be one or more nodes in a grid.
  • Nodes can be launched on multiple machines with different platforms and browsers.
  • The machines running the nodes need not be the same platform as that of the hub.


Tell  u one gud way to test  selenium grid...

1.create three folders  any drive C OR D drive...
      eg:
            folder name  like give

                     1. test1
                     2.test2
                     3.test3

2.keep selenium server standalone jar file in all three folders..

TEST1 FOLDER -HUB

first TEST1 folder..inside keep selenium server standalone -change  to name to...( sss ) y because easy to type in cmd prompt...





TWO WAYS U CAN START HUB...

1.FIRST STEP

type in cmd prompt

eg..Default C drive change to E ......type E: --enter --change to  E drive..thn  type cd test1 ..thn type blow code

code: java -jar sss.jar -role hub









2.SAME  STEP DIFFERENT WAY

1.open notepad  paste tis code inside notepad...

code :   java -jar sss.jar -role hub

save  name as -(test1.bat)------ save as inside TEST1 folder..





double click on  test1.bat  file it wil open cmd prompt and created as hub





Then type in firefox or chrome.. as ---- localhost:4444

it opens page like as below






TEST2 FOLDER - NODE1


same thing do for test2 folder also

1.keep selenium server standalone  jar file
2.create bat file inside test2 folder also

FIRST STEP:

1.go to cmd prompt set to path upto test2 folder..thn type blow code

code:java -jar sss.jar -role node -hub http://192.168.43.16:4444/grid/register -port 5566






PRESS ENTER -it wil display below like screen-means node created































Refresh in chrome or firefox once ...u can see down screen..




















Running a Sample Test Case on the Grid



































No comments:

Post a Comment