0

我目前正在尝试在 Linux VM(无头)上设置 Selenium 节点。集线器正在通过端口 5786(4444 正在使用)上的 Windows 设备运行。

我使用以下代码启动集线器:

java -jar selenium-server-standalone-
2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558

当我执行此操作时,它返回以下错误消息:

13:42:12.765 INFO - Launching a Selenium Grid node
13:42:13.435 WARN - error getting the parameters from the hub. The node may 
end up with wrong timeouts.Connect to 10.146.48.80:4444 [/10.146.48.80] 
failed: Connection refused
13:42:13.445 INFO - Java: Oracle Corporation 24.60-b09
13:42:13.445 INFO - OS: Linux 3.10.0-514.21.1.el7.x86_64 amd64
13:42:13.450 INFO - v2.53.0, with Core v2.53.0. Built from revision 35ae25b
13:42:13.521 INFO - Driver provider 
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, 
ensureCleanSession=true, browserName=internet explorer, version=}] does not 
match the current platform LINUX
13:42:13.521 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver 
registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, 
browserName=MicrosoftEdge, version=}] does not match the current platform 
LINUX
13:42:13.521 INFO - Driver class not found: 
com.opera.core.systems.OperaDriver
13:42:13.521 INFO - Driver provider com.opera.core.systems.OperaDriver is not 
registered
13:42:13.522 INFO - Driver provider org.openqa.selenium.safari.SafariDriver 
registration is skipped:
registration capabilities Capabilities [{platform=MAC, browserName=safari, 
version=}] does not match the current platform LINUX
13:42:13.523 INFO - Driver class not found: 
org.openqa.selenium.htmlunit.HtmlUnitDriver
13:42:13.523 INFO - Driver provider 
org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
13:42:13.552 INFO - Version Jetty/5.1.x
13:42:13.553 INFO - Started HttpContext[/selenium-server/driver,/selenium-
server/driver]
 13:42:13.553 INFO - Started HttpContext[/selenium-server,/selenium-server]
13:42:13.553 INFO - Started HttpContext[/,/]
13:44:03.596 INFO - Started 
org.openqa.jetty.jetty.servlet.ServletHandler@188fd321
13:44:03.596 INFO - Started HttpContext[/wd,/wd]
13:44:03.599 INFO - Started SocketListener on 0.0.0.0:5555
13:44:03.599 INFO - Started org.openqa.jetty.jetty.Server@a01330f
13:44:03.599 INFO - Selenium Grid node is up and ready to register to the hub
13:44:03.630 INFO - Starting auto registration thread. Will try to register 
every 5000 ms.
13:44:03.630 INFO - Registering the node to the hub: 
http://10.146.48.80:4444/grid/register
13:44:03.638 INFO - Couldn't register this node: Error sending the 
registration request: Connect to 10.146.48.80:4444 [/10.146.48.80] failed: 
Connection refused
4

1 回答 1

1

在您共享的命令中,即

java -jar selenium-server-standalone-2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558

您有复制粘贴问题。-before 参数hub似乎不是一个字符hyphen

我能够推断这是一个可能的根本原因,因为 的值被完全忽略并且正在尝试使用-hub默认的集线器端口。4444您共享的堆栈跟踪重复了这一点

13:42:13.435 WARN - 从集线器获取参数时出错。节点可能以错误的超时结束。连接到 10.146.48.80:4444 [/10.146.48.80] 失败:连接被拒绝

如您所见,即使您提供 Hub 的注册 URL 以包含端口号 5786,它仍然会启动4444并抱怨Connection refused.

请尝试输入整个命令以启动集线器,然后重试。那应该行得通。

于 2017-07-08T09:08:13.437 回答