Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Selenium Grid

I am setting up Selenium Grid server and I have done successfully on my local machine and I'm wondering how to give the hostname so if other tester wants to register to the hub they should be able to do that, here is what I have done so far:

on my local machine (assuming I will be allowing other tester to register the node here)

Starting a Hub on my local machine:

java -jar selenium-server-standalone-2.21.0.jar -hub

Starting a Node

java -jar selenium-server-standalone-2.21.0.jar -role node  -hub localhost:4444/grid/register

I view the status of the hub: localhost:4444/grid/console

Now, my question is: How to register from another machine?

on my other machine I have downloaed the selenium-server-standalone jar file and I run this command

java -jar selenium-server-standalone-2.21.0.jar -role node  -hub localhost:4444/grid/register

I get this error:

hub down or not responding

I know I should not be giving the localhost from other machine and I'm confused here.

like image 879
Nick Kahn Avatar asked Jan 19 '26 02:01

Nick Kahn


2 Answers

You can start the selenium grid as follows

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

You can start the selenium node as follows

java -jar selenium-server-standalone-2.21.0.jar -role node -hubHost <<hostname/ip>> -hubPort 4444

Instead of the string <<hostname/ip>>, give the hostname or ip of the machine where hub is running. If both the node & hub are in same machine, you need to use localhost or 127.0.0.1

like image 139
Harshavardhan Konakanchi Avatar answered Jan 21 '26 18:01

Harshavardhan Konakanchi


You need to give the IP address of the machine on which the Hub is running. Check if the IP is routable from the remote "other" machine.

like image 44
Amey Avatar answered Jan 21 '26 20:01

Amey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!