Search code examples
selenium-grid

Can't reach connection to Selenium Server hub from virtual node


So, I have PC with Windows 10 Pro, and virtual Windows 10 Pro installed on the same PC via VMWare workstation, network adapter mode in virtual OS set to "NAT".

I run this command on real OS (hub):

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

And this command on virtual OS (node):

java -jar selenium-server-standalone-3.141.59.jar -role node -nodeConfig nodeconfig.json

nodeconfig.json contains this:

{
  "capabilities":
  [
    {
      "browserName": "chrome",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 5,
  "port": -1,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://192.168.116.1:4444/grid/register/",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

When I'm trying to connect node to hub, I got this message in console:

Registered a node http://192.168.116.1:4444
Marking the node http://192.168.116.1:4444 as down: cannot reach the node for 2 tries

How can I solve this ? I already tried to set virtual OS network adapter mode to "Bridged", but in this case I can't get connection at all ...


Solution

  • That was a problem with firewall, after turning it off everything seems to work.