Activity: Creating a Small Selenium Grid with a Remote Node

On student A's laptop/machine:

  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. Get student A's laptop/machine IP (will be needed for the next steps).

On student's B laptop/machine:

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

Replace studentA_machine_IP for the actual IP of the laptop/machine that student A is using, which is the one where the Grid Hub is running.

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

We have created a small Selenium Grid. Now let's run our AgeCalculatorTest against it:

  1. Switch the remote Grid Hub url from localhost to the IP of student A's laptop/ machine:

driver = new RemoteWebDriver(new URL("http://studentA_ machine_IP:4444/wd/hub"), desiredCapabilities);
  1. Compile and run the test. We should be able to see on Student A's console how the test request is received, and how Google Chrome opens on Students B's laptop/machine.
..................Content has been hidden....................

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