0

I am trying to initiate a Selenium Grid hub on my Mac and then set up a node on a Windows 7 VM also on my Mac (running in VirtualBox, if that matters). I am running this command on the Mac:

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

And then I get

Nodes should register to http://10.10.3.1:4444/grid/register/
Selenium Grid hub is up and running

Awesome, great. I then go into my Windows VM and run the following command:

java -jar selenium-server-standalone-3.0.1.jar -role webdriver -hub http://10.10.3.1:4444/grid/register -port 7777 -debug

It will eventually timeout, unable to connect. I pasted the debug info below.

12:12:11.806 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
12:12:11.806 INFO - Launching a Selenium Grid node
12:12:12.817 DEBUG - CookieSpec selected: default
12:12:12.827 DEBUG - Auth cache not set in the context
12:12:12.827 DEBUG - Connection request: [route: {}->http://10.10.3.1:4444][tota
l kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
12:12:12.857 DEBUG - Connection leased: [id: 0][route: {}->http://10.10.3.1:4444
][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
12:12:12.887 DEBUG - Opening connection {}->http://10.10.3.1:4444
12:12:12.887 DEBUG - Connecting to /10.10.3.1:4444
12:12:32.753 DEBUG - http-outgoing-0: Shutdown connection
12:12:32.753 DEBUG - Connection discarded
12:12:32.753 DEBUG - Connection released: [id: 0][route: {}->http://10.10.3.1:44
44][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]

12:12:32.753 WARN - error getting the parameters from the hub. The node may end
up with wrong timeouts.Connect to 10.10.3.1:4444 [/10.10.3.1] failed: Connection
 timed out: connect
2017-02-02 12:12:32.793:INFO::main: Logging initialized @22740ms
12:12:32.881 INFO - Driver class not found: com.opera.core.systems.OperaDriver
12:12:32.881 INFO - Driver provider com.opera.core.systems.OperaDriver registrat
ion is skipped:
Unable to create new instances on this machine.
12:12:32.881 INFO - Driver class not found: com.opera.core.systems.OperaDriver
12:12:32.881 INFO - Driver provider com.opera.core.systems.OperaDriver is not re
gistered
12:12:32.891 INFO - Driver provider org.openqa.selenium.safari.SafariDriver regi
stration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform
=MAC}] does not match the current platform VISTA
2017-02-02 12:12:32.999:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2017-02-02 12:12:33.058:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletC
ontextHandler@92efc3{/,null,AVAILABLE}
2017-02-02 12:12:33.077:INFO:osjs.ServerConnector:main: Started ServerConnector@
ee2816{HTTP/1.1}{0.0.0.0:7777}
2017-02-02 12:12:33.077:INFO:osjs.Server:main: Started @23031ms
12:12:33.077 INFO - Selenium Grid node is up and ready to register to the hub
12:12:33.097 DEBUG - Using the json request : {"class":"org.openqa.grid.common.R
egistrationRequest","configuration":{"hubHost":"10.10.3.1","hubPort":4444,"id":"
http://10.0.2.15:7777","capabilities":[{"browserName":"firefox","seleniumProtoco
l":"WebDriver","maxInstances":5,"platform":"VISTA"},{"browserName":"chrome","sel
eniumProtocol":"WebDriver","maxInstances":5,"platform":"VISTA"},{"browserName":"
internet explorer","seleniumProtocol":"WebDriver","maxInstances":1,"platform":"W
INDOWS"}],"hub":"http://10.10.3.1:4444/grid/register","nodeStatusCheckTimeout":5
000,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","register":true,
"registerCycle":5000,"custom":{},"host":"10.0.2.15","maxSession":1,"debug":false
,"port":7777,"role":"node","timeout":1800}}
12:12:33.185 INFO - Starting auto registration thread. Will try to register ever
y 5000 ms.
12:12:33.185 INFO - Registering the node to the hub: http://10.10.3.1:4444/grid/
register
12:12:33.215 DEBUG - CookieSpec selected: default
12:12:33.224 DEBUG - Auth cache not set in the context
12:12:33.224 DEBUG - Connection request: [route: {}->http://10.10.3.1:4444][tota
l kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
12:12:33.224 DEBUG - Connection leased: [id: 1][route: {}->http://10.10.3.1:4444
][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
12:12:33.224 DEBUG - Opening connection {}->http://10.10.3.1:4444
12:12:33.224 DEBUG - Connecting to /10.10.3.1:4444
12:12:54.760 DEBUG - http-outgoing-1: Shutdown connection
12:12:54.760 DEBUG - Connection discarded
12:12:54.760 DEBUG - Connection released: [id: 1][route: {}->http://10.10.3.1:44
44][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]

12:12:54.760 INFO - Couldn't register this node: Error sending the registration
request: Connect to 10.10.3.1:4444 [/10.10.3.1] failed: Connection timed out: co
nnect

*edit: I tried to run the hub and node both on the windows VM, and it worked with no issues. I also tried to run the hub and node on the Mac only, and I got the same issue. That says to me that the issue somehow is related to my Mac. No clue what to do....

kroe761
  • 3,296
  • 9
  • 52
  • 81

2 Answers2

0

It turns out the server, in attempting to automatically assign an IP address to the hub, chose the wrong one. For some reason it was choosing the IP address of the vpn gateway. adding -host 10.11.xx.xx fixed my problem.

kroe761
  • 3,296
  • 9
  • 52
  • 81
0

I didn't thought it was as simple as 1-2-3 to setup selenium grid

because I spent couple of hours browsing around and running different commands. I wish I landed on this page first, might have saved my time.

Thanks to kroe761. This is the same solution, but writing them in simple steps that worked for me. Common mistake: I wasn't paying attention to Step2, it has clearly stated the URL where to register the node, I have been using windows10 ip-address, Due to which the node wasn't connecting to the hub

  1. Downloaded latest stable version of selenium server jar file from here: https://selenium.dev/downloads/ And placed jar file in both machines that I planned to use, one for hub and other for node In my case, I am using windows10 for hub and windows7 VM for node

  2. Executed following command in windows10 - command prompt java -jar selenium-server-standalone-3.xxx.xx.jar -role hub

15:00:44.044 INFO [Hub.start] - Selenium Grid hub is up and running

15:00:44.045 INFO [Hub.start] - Nodes should register to http://10.0.0.xxx:4444/grid/register/

  1. Executed following command in windows7 - command prompt java -jar selenium-server-standalone-3.xxx.xx.jar -role webdriver -hub http://10.10.0.xxx:4444/grid/register -port 7777

15:15:51.097 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://10 .0.0.xxx:4444/grid/register

15:15:56.394 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and read y to use

  • Can i use any random IP address like in your cases you changed it from 10.0.0.xxx to 10.10.0.xxx? For me its 10.20.x.x and i am trying to use 10.25.x.x to connect a node but it is not working. – shivam May 04 '21 at 10:56