更多关于您的用例和您使用的命令以及文本格式的跟踪日志将有助于以更好的方式分析问题。但是,当我通过以下命令启动Selenium Grid Hub时,在我的本地主机(Windows 10)上:
C:\selenium-server-standalone>java -jar selenium-server-standalone-3.141.59.jar -role hub
生成的日志消息如下:
02:40:05.385 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
02:40:06.025 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
2019-08-03 02:40:07.963:INFO::main: Logging initialized @4684ms to org.seleniumhq.jetty9.util.log.StdErrLog
02:40:10.538 INFO [Hub.start] - Selenium Grid hub is up and running
02:40:10.554 INFO [Hub.start] - Nodes should register to http://192.168.43.186:4444/grid/register/
02:40:10.554 INFO [Hub.start] - Clients should connect to http://192.168.43.186:4444/wd/hub
因此,Selenium Grid 节点应注册到http://192.168.43.186:4444/grid/register/
(而不是http://localhost:4444/grid/register/
),如下所示:
C:\selenium-server-standalone>java -jar selenium-server-standalone-3.141.59.jar -role node -port 5566 -hub http://192.168.43.186:4444/grid/register
02:45:55.856 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
02:45:56.216 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 5566
2019-08-03 02:45:57.638:INFO::main: Logging initialized @2866ms to org.seleniumhq.jetty9.util.log.StdErrLog
02:45:58.747 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
02:45:59.153 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 5566
02:45:59.153 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid node is up and ready to register to the hub
02:45:59.669 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
02:46:01.731 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://192.168.43.186:4444/grid/register
02:46:02.278 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
以下日志消息由Selenium Grid Hub生成:
02:46:02.278 INFO [DefaultGridRegistry.add] - Registered a node http://192.168.43.186:5566