我在物理 Windows 机器上设置了一个集线器。我正在尝试设置一个节点以连接到 headless Linux Red Hat VM 上的此集线器。
我使用这个命令来启动节点:
java -jar selenium-server-standalone-3.4.0.jar -role
node -hub http://<IP>:5786/grid/register
此节点使用以下堆栈跟踪在终端中成功注册
10:38:55.935 INFO - Selenium build info: version: '3.4.0', revision:
'unknown'
10:38:55.936 INFO - Launching a Selenium Grid node
2017-07-11 10:38:56.716:INFO::main: Logging initialized @1140ms to
org.seleniumhq.jetty9.util.log.StdErrLog
10:38:56.800 INFO - Driver provider
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true,
browserName=internet explorer, version=, platform=WINDOWS}] does not match
the current platform LINUX
10:38:56.800 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver
registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=,
platform=WINDOWS}] does not match the current platform LINUX
10:38:56.800 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:38:56.800 INFO - Driver provider com.opera.core.systems.OperaDriver
registration is skipped:
Unable to create new instances on this machine.
10:38:56.800 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:38:56.800 INFO - Driver provider com.opera.core.systems.OperaDriver is not
registered
10:38:56.801 INFO - Driver provider org.openqa.selenium.safari.SafariDriver
registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=,
platform=MAC}] does not match the current platform LINUX
2017-07-11 10:38:56.860:INFO:osjs.Server:main: jetty-9.4.3.v20170317
2017-07-11 10:38:56.905:INFO:osjsh.ContextHandler:main: Started
o.s.j.s.ServletContextHandler@96def03{/,null,AVAILABLE}
2017-07-11 10:38:56.922:INFO:osjs.AbstractConnector:main: Started
ServerConnector@69b2283a{HTTP/1.1,[http/1.1]}{0.0.0.0:5555}
2017-07-11 10:38:56.923:INFO:osjs.Server:main: Started @1346ms
10:38:56.923 INFO - Selenium Grid node is up and ready to register to the hub
10:38:56.967 INFO - Starting auto registration thread. Will try to register
every
5000 ms.
10:38:56.968 INFO - Registering the node to the hub:
http://<IP>/grid/register
10:38:57.322 INFO - The node is registered to the hub and ready to use
然而,当我进入控制台时,出现以下消息:
DefaultRemoteProxy unknown version,Connect to <IP>:5555 [/<IP>] failed: connect timed out
此外,在我的集线器终端中出现以下消息:
11:00:26.189 INFO - Unregistering the node http://<IP of NODE>:5555 because
it's been down for 60006 milliseconds
11:00:33.615 WARN - Cleaning up stale test sessions on the unregistered node
http://<IP of NODE>:5555
这只会一遍又一遍地循环。
我对此进行了很多调查,但未能找到任何有用的信息。
我发现最接近的是使用网桥连接而不是 NAT 连接,但我在公司环境下,无法摆弄任何这些设置。
编辑
08:53:22.664 INFO - Selenium build info: version: '3.4.0', revision:
'unknown'
08:53:22.665 INFO - Launching a Selenium Grid node
2017-07-12 08:53:23.505:INFO::main: Logging initialized @1194ms to
org.seleniumhq.jetty9.util.log.StdErrLog
08:53:23.590 INFO - Driver provider
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true,
browserName=internet explorer, version=, platform=WINDOWS}] does not match
the current platform LINUX
08:53:23.591 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver
registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge,
version=, platform=WINDOWS}] does not match the current platform LINUX
08:53:23.591 INFO - Driver class not found:
com.opera.core.systems.OperaDriver
08:53:23.591 INFO - Driver provider com.opera.core.systems.OperaDriver
registration is skipped:
Unable to create new instances on this machine.
08:53:23.591 INFO - Driver class not found:
com.opera.core.systems.OperaDriver
08:53:23.591 INFO - Driver provider com.opera.core.systems.OperaDriver is not
registered
08:53:23.592 INFO - Driver provider org.openqa.selenium.safari.SafariDriver
registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=,
platform=MAC}] does not match the current platform LINUX
2017-07-12 08:53:23.650:INFO:osjs.Server:main: jetty-9.4.3.v20170317
2017-07-12 08:53:23.699:INFO:osjsh.ContextHandler:main: Started
o.s.j.s.ServletContextHandler@363ee3a2{/,null,AVAILABLE}
2017-07-12 08:53:23.715:INFO:osjs.AbstractConnector:main: Started
ServerConnector@cd3fee8{HTTP/1.1,[http/1.1]}{0.0.0.0:8151}
2017-07-12 08:53:23.715:INFO:osjs.Server:main: Started @1404ms
08:53:23.724 INFO - Selenium Grid node is up and ready to register to the hub
08:53:23.765 INFO - Starting auto registration thread. Will try to register
every 5000 ms.
08:53:23.765 INFO - Registering the node to the hub:
http://10.56.130.102:5786/grid/register
08:53:24.114 INFO - The node is registered to the hub and ready to use
最佳答案
您的问题是您的 Windows 计算机在端口 5555
上的出站连接,该端口是节点运行的默认端口,被您的 Windows 计算机中的防火墙阻止。请查看this链接可帮助您在 Windows 上打开端口。
这也解释了为什么从节点到 hub 的注册是成功的,但是随后 Hub 将节点标记为 down/stale 然后删除它,因为它无法建立 HTTP GET
到状态 URL节点公开。
由于通常端口 8080
总是在机器上打开,您可以尝试在此端口上运行您的 node
,以便集线器可以 ping 回节点以进行状态查询.
Ping 一台机器,然后触发一个 http 操作,如 HTTP GET
似乎不是一回事。参见 this获取更多信息。
关于java - 将远程机器注册为节点在网格控制台上提供连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45038220/