【问题标题】:Selenium grid can't connect to hubSelenium 网格无法连接到集线器
【发布时间】:2021-08-03 22:30:30
【问题描述】:

我正在尝试连接到我自己的 selenium 网格集线器。我正在为节点使用 Windows 10。用于集线器的 Mac。

我在 Mac 上运行这个命令。

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

它正在准备注册节点

07:08:15.219 INFO [Hub.start] - Selenium Grid hub is up and running
07:08:15.219 INFO [Hub.start] - Nodes should register to http://192.168.1.104:4444/grid/register/
07:08:15.220 INFO [Hub.start] - Clients should connect to http://192.168.1.104:4444/wd/hub

然后我尝试使用此命令连接到集线器

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.104:4444/grid/register/

它永远不会连接到集线器并永远尝试

07:10:48.658 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
07:10:48.753 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 20519
2021-08-04 07:10:48.885:INFO::main: Logging initialized @648ms to org.seleniumhq.jetty9.util.log.StdErrLog
07:10:49.063 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
07:10:49.149 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 20519
07:10:49.150 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid node is up and ready to register to the hub
07:10:49.178 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
07:11:10.382 WARN [SelfRegisteringRemote.registerToHub] - Error getting the parameters from the hub. The node may end up with wrong timeouts.Failed to connect to /192.168.1.104:4444
07:11:10.383 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://192.168.1.104:4444/grid/register
07:11:31.415 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: Error sending the registration request: Failed to connect to /192.168.1.104:4444
07:11:57.463 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: Failed to connect to /192.168.1.104:4444
07:12:23.513 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: Failed to connect to /192.168.1.104:4444
07:12:49.556 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: Failed to connect to /192.168.1.104:4444
07:13:15.600 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: Failed to connect to /192.168.1.104:4444

我的 Mac 仍在运行,但这表示没有响应...

我该如何解决这个问题?

【问题讨论】:

  • 您好,欢迎来到 Stackoverflow!也许您的问题与网络有关;您是否检查过您的 Mac 是否没有阻塞所需的端口?两台电脑在同一个网络?他们可以看到任何其他正在运行的服务吗?
  • 您好,先生! Mac 没有阻塞端口。但是两台计算机都在同一个网络上。如果他们的计算机在同一个网络上,我应该做些什么吗?

标签: java selenium


【解决方案1】:

您需要在服务器端口之后启动节点,而不需要任何其他路径。见documentation

你的命令是:

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.104:4444

【讨论】:

  • 感谢您提供遮阳篷。我尝试了那个稍微改变输出的命令。但仍然无法连接。出现这样的错误 07:11:10.382 WARN [SelfRegisteringRemote.registerToHub] - 从集线器获取参数时出错。节点可能以错误的超时结束。无法连接到 /192.168.1.104:4444 你对此有什么想法吗?
  • 我尝试使用该命令从 Windows 连接 mac,然后就可以了!非常感谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-12-22
  • 1970-01-01
  • 2017-10-11
  • 1970-01-01
  • 2022-09-27
  • 2015-07-09
  • 1970-01-01
相关资源
最近更新 更多