我遇到了一个错误:无法注册此节点

时间:2017-04-15 14:19:01

标签: selenium selenium-webdriver selenium-grid

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

这是我的配置文件config.json

我在命令行上运行:

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

但我遇到了这样的错误,我找不到答案:

21:27:48.334 INFO - Couldn't register this node: The hub is down or not respondi
ng: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] f
ailed: Connection refused: connect

我不明白为什么会这样?

1 个答案:

答案 0 :(得分:0)

您的错误明确指出节点未在端口4444上侦听在本地主机上运行的集线器。 正如Krishnan上面提到的,您需要首先使用命令

启动集线器

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

此命令将在localhost上启动集线器,默认情况下使用4444端口。