Adding Selenium Nodes to the Grid Hub

A Grid Hub is only useful if it is capable of distributing automation script requests to the existing Nodes in the Grid. For a local Selenium Grid, the Grid Hub and the Selenium Nodes are on the same machine. To add a new Selenium Node to the Hub, follow these steps:

  1. Open a Command Prompt window (different than the one used to start the Hub).
  2. Navigate to the directory where the selenium-server-standalone file is located.
  3. Write and run this command (all on the same line):
java -jar selenium-server-standalone-<version>.jar -role
node -hub http://localhost:4444/grid/register

The default value of the Node port is 5555, if not specified. If the port is not free, any random free port will be used. You should receive a confirmation message. Since we used the standard command, the newly registered Node will be able to handle requests for the browsers that are installed on the machine where the command was executed (the machine used for this example has Chrome, Firefox, and Safari).

  1. Optionally, to create a Selenium Node for a specific OS and browser, use the following command on step 3:
java -jar selenium-server-standalone-<version>.jar
-role node -hub http://localhost:4444/grid/register
-browser "browserName=internet explorer, maxInstances=1,
platform=WINDOWS"

Be aware that the previous command only makes sense if it is executed on a Windows machine. If this was executed on a macOS machine, the Hub will discard the internet explorer browser bit because it is not possible to run Internet Explorer on macOS.

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

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