Sunday, September 2, 2018

How To Configure Selenium Grid Two Node To Piece Of Occupation Webdriver Test

| Sunday, September 2, 2018
As described In my EARLIER POST, Selenium grid 2 Is useful to execute webdriver software tests on multiple nodes In parallel. So nosotros take away to set upwards selenium grid 2 nodes for webdriver software examination execution. But earlier that, Your selenium grid hub should hold upwards configured as well as inward running fashion equally described inward my PREVIOUS POST. Now lets configure selenium grid 2 unmarried node to execute webdriver software automation tests inward parallel inward selenium grid.

Note : Here nosotros are configuring selenium grid node on same machine where selenium grid hub is running for your slowly understanding. Later on nosotros volition larn how to configure hub as well as nodes on dissimilar machines as well as run software automation examination on it.

What Is Node
Node is the indicate which convey examination requests from hub as well as execute them. We tin plough over the sack configure node inward such a way to execute tests inward parallel on dissimilar browsers at the same time. Also nosotros tin plough over the sack laid max position out of browsers allowed to run examination at a time, timeout etc. inward upcoming posts.

Registering Selenium Grid 2 Node To Hub
We take away to register selenium grid node to hub hence that hub tin plough over the sack sympathise where to run software automation tests when have asking for examination execution. But earlier that delight read bellow given prerequisites.

Prerequisites :
  • Selenium grid hub should hold upwards In running fashion equally described In previous post.
  • "chromedriver.exe" file should hold upwards located inward D: drive. It volition hold upwards needed to run tests inward google chrome browser. Read THIS POST to know from where to download it if yous produce non have "chromedriver.exe" file.
  • "IEDriverServer.exe" file should hold upwards located in D: drive. It volition hold upwards needed to run tests inward Internet explorer browser.Read THIS POST to know from where to download it if yous produce non have "IEDriverServer.exe" file.
  • Internet explorer browser's protected modes should hold upwards enabled for all zones equally described in THIS POST and browser zoom marking should hold upwards laid to 100% equally described inward THIS POST.
Now follow the steps given bellow.
  1. Open unopen to other ascendance prompt (Separate than hub ascendance prompt).
  2. Navigate to D: motility past times typing ascendance D: inward ascendance prompt.
  3. Type bellow given ascendance syntax inward ascendance prompt as well as press ENTER button.
java -jar selenium-server-standalone-2.52.0.jar -role node -Dwebdriver.ie.driver="D:/IEDriverServer.exe" -Dwebdriver.chrome.driver="D:/chromedriver.exe" -hub http://localhost:4444/grid/register -port 5566

Command elements
  • selenium-server-standalone-2.52.0.jar -> Selenium standalone server jolt file. Modify It equally per your jolt file version inward in a higher house ascendance if it is non 2.52.0.
  • 5566 -> port position out which volition hold upwards used past times node.
  • http://localhost:4444/grid/register : URL to register node where hub is running. Our electrical current configuration is running hub as well as nodes on same machine hence localhost inward URL volition operate here. 
  • Note : If node Is running on dissimilar machine than the hub machine as well as hence yous take away to supervene upon IP address of hub machine alongside "localhost" inward in a higher house URL.
  • -Dwebdriver.ie.driver="D:/IEDriverServer.exe" : Set path of IEDriverServer.exe file for node to run examination inward network explorer browser.
  • -Dwebdriver.chrome.driver="D:/chromedriver.exe" : Set path of chromedriver.exe file for node to run examination inward google chrome browser.
Note : Please restart hub as well as node if confront whatsoever effect on whatsoever phase during test. To restart grid 2 node
  • Press CTRL+c keys of keyboard to shutdown node.
  • Run inward a higher house ascendance in 1 lawsuit once again to register node alongside hub.
We tin plough over the sack besides configure how many browsers yous take away on specific node(Example : 2 Firefox, iii chrome as well as iii IE browsers) as well as max how many allowed browsers to run on specific node. We volition larn it inward upcoming posts.

Verify whether grid node is running fine
When yous type inward a higher house ascendance In ascendance prompt, It volition exhibit yous message similar "The node is registered to the hub as well as cook to use" equally shown In bellow Image. That agency yous stimulate got configured node properly.


Now If yous access URL : http://localhost:4444/grid/console. It volition exhibit yous page similar bellow.

You tin plough over the sack see, in that place are dissimilar browsers similar 1 IE, five Firefox as well as five chrome browsers which yous tin plough over the sack utilisation to run your software automation test. Now, Selenium grid is cook to utilisation where hub as well as 1 node are running on same machine.

Now supposing nosotros stimulate got 1 examination illustration as well as wants to execute it inward parallel inward dissimilar iii browsers. Can nosotros produce it using this configuration? Answer is Yes.. View my NEXT POST to know how to produce it using selenium grid 2.

Related Posts