Selenium Grid Setup
To set up the Selenium Grid environment, you must download the Selenium Grid Server.
Download Selenium Server
Open a web browser.
Launch the following URL:
https://www.selenium.dev/downloads/
Download the Selenium server.
Grid Configuration Setup
The grid configuration involves two major steps.
- Setup the Hub
- Setup the nodes. You can setup multiple nodes on different machines registering to the hub.
Selenium Hub Setup
Open the command prompt.Change working directory to the folder where you downloaded the Selenium server jar file.
To set up the selenium hub, issue the following command:
/> java -jar selenium-server-standalone-<version>.jar -role hub
Â
The command line flag -role hub will start the server as hub. By default, the hub will start at port 4444. However, you can change this with -port command line flag. Avoid port conflicts with existing applications while using the port flag.Â
For example, to start the hub at port 7777, you can use the flag -port 7777
Grid Console
The Grid console can be viewed on the browser. Open a web browser and launch the following URL:
Â
Selenium Node Setup
Selenium node setup is to register the node to the hub. Open the command prompt and issue the following command to register the node.
/> java -jar selenium-server-standalone-3.141.5.jar -role node -hub http://localhost:4444/grid/register -browser “browserName=chrome”
Â
The register URL for the hub is:
- http://localhost:4444/grid/register
However, you can replace it with the IP address or domain where the hub runs in a real-time environment.
This will register a Chrome node to the hub. The registered node should reflect in the grid console. Open the grid console and confirm that the node configuration is displayed.
Â