Configure node by using JSON file

In the previous post, we have seen how to configure hub and nodes. In this post, we will see how to configure node by using JSON file.

We can mention all the configuration details into the JSON file and then start Hub or node by entering the commands in cmd window. Let’s understand this step by step.

Starting Hub:

For starting hub, we will use the below JSON file. Copy the below code and store it with some name but with the extension json.

Use the below command where we will given the hub_config.json file.

java -jar selenium-server-standalone-2.45.0.jar -role hub hub_config.json

The Hub should start at the port no. 4444.

Starting node by using JSON file:

We have created one more JSON file containing the node capabilities and configuration details. Copy the below code and save into a file with the extension Json.

Open a new command window and use the below command to start the node by using node_1.Json file.

java -jar selenium-server-standalone-2.45.0.jar -role node -hub http://localhost:4444/grid/register -nodeConfig node_1.json

To verify if node has started successfully , go to http://localhost:4444/grid/console. You should be able to see the below window.

Node Json

 

In the next post, we will see how to write a program to distribute test cases on nodes.


Ask Question
Have any question or suggestion for us?Please feel free to post in Q&A Forum
Print Friendly, PDF & Email
Configure Hub and nodes in Selenium Grid
Run Test cases by using Selenium Grid
Shekhar Sharma

Shekhar Sharma

Shekhar Sharma is founder of testingpool.com. He is an automation engineer having more than 8 years of experience who loves troubleshooting in automation and finding innovative ways to solve the problems. His other leisurely activities includes playing harmonica, paintings, sketching portrait, watching movies and travelling etc.

You may also like...