【问题标题】:Selenium Grid: Unable to start selenium grid hubSelenium Grid:无法启动 selenium 网格集线器
【发布时间】:2021-12-22 19:47:40
【问题描述】:

从这里下载 selenium-server-4.0.0.jar 后

https://www.selenium.dev/downloads/

我把这个jar文件放在c文件夹中,然后 使用 cmd 我尝试使用此命令启动 selenium 网格集线器

java -jar selenium-server-4.0.0.jar hub

我无法运行 selenium 网格集线器,它显示以下内容

C:\>java -jar selenium-server-4.0.0.jar hub
12:29:21.621 INFO [LogManager$RootLogger.log] - Using the system default encoding
12:29:21.624 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
12:29:22.034 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442,
advertising as tcp://192.168.100.8:4442], XSUB binding to [binding to tcp://*:4443, 
advertising as tcp://192.168.100.8:4443]
12:29:22.073 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.100.8:4442 and 
tcp://192.168.100.8:4443
12:29:22.094 INFO [UnboundZmqEventBus.<init>] - Sockets created
12:29:23.110 INFO [UnboundZmqEventBus.<init>] - Event bus ready
12:29:24.443 INFO [Hub.execute] - Started Selenium Hub 4.0.0 (revision 3a21814679): 
http://192.168.100.8:4444

我试着把这个网址放在 chrome 浏览器中

http://192.168.100.8:4444 

然后它显示这个

Unable to find /index.html

【问题讨论】:

  • 看起来非常好。网格控制台的 url 现在是 http://192.168.100.8:4444/ui/index.html#/

标签: selenium selenium-webdriver webdriver selenium-chromedriver selenium-grid


【解决方案1】:

似乎selenium-server-4.0.0.jar 已损坏或未正确下载。

删除当前的 Selenium Server jar 并从 Downloads 页面下载新副本。

将 HUB 启动为:

C:\Users\Admin\Desktop\My Own Downloads\SeleniumServer>java -jar selenium-server-4.0.0.jar hub

您将看到以下日志消息:

15:07:34.490 INFO [LogManager$RootLogger.log] - Using the system default encoding
15:07:34.490 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
15:07:35.058 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://192.168.225.29:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://192.168.225.29:4443]
15:07:35.136 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.225.29:4442 and tcp://192.168.225.29:4443
15:07:35.168 INFO [UnboundZmqEventBus.<init>] - Sockets created
15:07:36.169 INFO [UnboundZmqEventBus.<init>] - Event bus ready
15:07:37.842 INFO [Hub.execute] - Started Selenium Hub 4.0.0 (revision 3a21814679): http://192.168.225.29:4444

现在您可以通过任一 url 访问 Selenium Grid 控制台:

  • http://localhost:4444
  • http://192.168.225.29:4444

控制台快照:

【讨论】:

    【解决方案2】:

    我有类似的问题。原来这是一个java问题。我有一些旧的 jdk8 版本。切换到jdk11后就可以正常使用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-14
      • 1970-01-01
      • 1970-01-01
      • 2017-08-01
      • 1970-01-01
      • 2011-06-24
      相关资源
      最近更新 更多