Adding Selenium Nodes Instances Running on Different Machines to the Grid Hub

Let's assume that we have two machines: one will serve as the Grid Hub, and the second one will serve as a Selenium Node that will connect to the Grid Hub. One machine will have the IP 192.168.1.5, and the second one will have the IP 192.168.1.10.

Starting a Grid Hub on one (physical or virtual) machine and a Selenium Node on a different (physical or virtual) machine requires the following steps:

On the machine that will host the Grid Hub (192.168.1.5) these steps need to be followed:

  1. Open a Command Prompt window.
  2. Navigate to the directory where the selenium-server-standalone file is located.
  3. Write and run this command:
java -jar selenium-server-standalone-<version>.jar -role
hub

The default value of the Hub port is 4444, if not specified.

  1. You should receive a confirmation message, similar to the one we saw in  Configuring and Connecting to a Local Grid.

On the machine that will host the Selenium Node (192.168.1.10) these steps need to be followed:

  1. Open a Command Prompt window.
  2. Navigate to the directory where the selenium-server-standalone file is located.
  3. Since we will only use the Chrome browser, write and run this command:
java -jar selenium-server-standalone-<version>.jar -role
node -hub http://192.168.1.5:4444/grid/register -browser
"browserName=chrome"

Note that the IP of the Grid Hub is used at the moment of registering the Selenium Node.

  1. Navigate to http://192.168.1.5:4444/grid/console to see the Grid Hub with the registered Selenium Node.

We are now able to understand how to configure and connect to a Network Selenium Grid.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.213.128