【发布时间】:2026-01-10 04:30:02
【问题描述】:
尝试在 Ubuntu 14 上通过带有 xvfb 的 ssh 在无头数字海洋机器上运行 selenium 节点。安装了所有软件包,chromium-browser 在 xvfb 上正确启动。
它的行为很奇怪:没有错误,但根本没有尝试连接集线器。而是仅启动 Jetty。
确切的命令行:
xvfb-run -a --server-args="-screen 0 1920x1280x24" java -Djava.net.preferIPv4Stack=true -jar selenium-server-standalone-2.48.2.jar -role node -Dwebdriver.chrome.driver=./chromedriver -hub "http://localhost:4444/grid/register" -browser "browserName=chrome, platform=LINUX, maxInstances=5, chrome.binary=/usr/bin/chromium-browser"
在我的本地 PC 上,节点尝试连接到集线器,而在无头数字海洋上没有任何反应,集线器没有在 /grid/console 页面上列出节点。 唯一的线索是节点日志的最后几行不同。
无头数字海洋:
11:55:53.483 INFO - Version Jetty/5.1.x
11:55:53.484 INFO - Started HttpContext[/selenium-server,/selenium-server]
我的电脑:
17:52:04.859 INFO - Selenium Grid node is up and ready to register to the hub
17:52:04.877 INFO - Starting auto registration thread. Will try to register every 5000 ms.
17:52:04.877 INFO - Registering the node to the hub: http://46.101.128.117:4444/grid/register
17:52:04.936 INFO - The node is registered to the hub and ready to use
有什么想法可能是错的吗?有没有人用类似的设置成功过?
Digital Ocean 的完整日志无头:
11:55:52.753 INFO - Launching a Selenium Grid node
11:55:52.820 INFO - Adding browserName=chrome, platform=LINUX, maxInstances=5, chrome.binary=/usr/bin/chromium-browser
Setting system property webdriver.chrome.driver to ./chromedriver
11:55:53.347 INFO - Java: Oracle Corporation 25.45-b02
11:55:53.348 INFO - OS: Linux 3.19.0-22-generic amd64
11:55:53.354 INFO - v2.48.0, with Core v2.48.0. Built from revision 41bccdd
11:55:53.433 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
11:55:53.434 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
11:55:53.434 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:55:53.435 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
11:55:53.483 INFO - Version Jetty/5.1.x
11:55:53.484 INFO - Started HttpContext[/selenium-server,/selenium-server]
在我的 PC 上运行的相同示例给出:
17:52:04.341 INFO - Launching a Selenium Grid node
17:52:04.387 INFO - Adding browserName=chrome, platform=LINUX, maxInstances=5, chrome.binary=/usr/bin/chromium-browser
Setting system property webdriver.chrome.driver to ./chromedriver
17:52:04.750 INFO - Java: Oracle Corporation 25.45-b02
17:52:04.750 INFO - OS: Linux 3.19.0-30-generic amd64
17:52:04.754 INFO - v2.48.0, with Core v2.48.0. Built from revision 41bccdd
17:52:04.816 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
17:52:04.817 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
17:52:04.818 INFO - Driver class not found: com.opera.core.systems.OperaDriver
17:52:04.818 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
17:52:04.859 INFO - Selenium Grid node is up and ready to register to the hub
17:52:04.877 INFO - Starting auto registration thread. Will try to register every 5000 ms.
17:52:04.877 INFO - Registering the node to the hub: http://46.101.128.117:4444/grid/register
17:52:04.936 INFO - The node is registered to the hub and ready to use
【问题讨论】:
标签: selenium ssh selenium-grid digital-ocean