我目前正在尝试在Linux VM(无头)上设置Selenium节点。集线器正在端口5786上的Windows设备上运行(4444正在使用中)。
我使用以下代码启动集线器:
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
答案 0 :(得分:1)
在您共享的命令中,
java -jar selenium-server-standalone-2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558
您有复制粘贴问题。参数-
之前的hub
似乎不是hyphen
个字符。
我能够将此推断为可能的根本原因,因为-hub
的值被完全忽略,并且正尝试使用4444
的默认集线器端口。您共享的堆栈跟踪重新迭代此
13:42:13.435 WARN - 从集线器获取参数时出错。节点可以 以错误的超时结束。连接到10.146.48.80:4444 [/10.146.48.80] 失败:拒绝连接
正如您所看到的,即使您提供的中心注册网址包含端口号5786,它仍然会接收4444
并抱怨Connection refused
。
请尝试键入整个命令以启动集线器,然后重试。这应该有用。