How can I set up Selenium Grid for cross browser testing?

Would anyone please provide some valid information on how can I set up Selenium Grid for cross browser testing.

Note – We have installed our development environment on a machine running Windows 10 OS. Hub and Node have been installed on the same machine.

Step 1: You need to download the Selenium server jar from here.

Step 2: Now you’ve to configure the hub. For that, you need to use this command (java -jar selenium-server-standalone-x.x.x.jar -role hub)

java -jar selenium-server-standalone-3.9.1.jar -role hub

Step 3: The hub would be using port number4444. If you want to update the port number, you can do it y using the configuration option –port . Check out the below screenshot of the logs.

To verify the configuration status, you need to open the browser and type(or paste) the following into the address bar:

http://107.108.86.20:4444/wd/hub

If you open the above in your Firefox browser, you’ll see the screen as the following:

Now, it is time to configure nodes to perform the cross browser testing.

Step 4: Run this command to the terminal: java -jar selenium-server-standalone-3.9.1.jar -role node -hub http:///grid/register/ -browser "browserName=firefox,maxinstance=1,platform=WINDOWS" –port:

Note: Here, the hub has been configured on port number 4444 and the node on port numbers 5555, and 5556. The 1st node has been configured on Windows platform and Mozilla Firefox browser. The 2nd node has been configured on Windows Platform and Chrome browser.

Step 5: Run the following command

java -jar selenium-server-standalone-3.9.1.jar -role node -hub http://107.108.86.20:4444/grid/register/ -browser "browserName=firefox,maxinstance=1,platform=WINDOWS" -port 5555

The output for the command is as shown below.

To verify the configuration working correctly, you’ll need to enter this into your browser’ss address bar.

http://localhost:4444/grid/console?config=true&configDebug=true#

To configure the note on port 5556(For Windows machine and Chrome browser), open the command prompt run the following command.

java -jar selenium-server-standalone-3.9.1.jar -role node -hub http://107.108.86.20:4444/grid/register/ -port 5556 -browser "browserName=chrome,maxinstance=1,platform=WINDOWS"

To see the details about port number 5556, visit http://localhost:4444/grid/console?config=true&configDebug=true#

More info: Selenium Grid Tutorial