org.openqa.selenium.WebDriverException:等待驱动程序服务器在 Linux 机器上开



我正在尝试在 Linux 构建代理(在 Bamboo 中(中运行一些 Selenium 自动化测试,当我从 docker 运行它们时,测试工作正常,但是当我直接在我的代理上安装 Chrome 和我需要的必要东西并运行它们时,我收到以下错误。

Starting ChromeDriver 75.0.3770.140 (2d9f97485c7b07dc18a74666574f19176731995c-refs/branch-heads/3770@{#1155}) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
2019-08-26 13:16:30:08S +0100 [SEVERE] onError:Timed out waiting for driver server to start.
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'xxxx', ip: '10.41.39.14', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.1.el7.x86_64', java.version: '1.8.0_191'
Driver info: driver.version: SeleniumDriver
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'xxxx', ip: 'xxxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.1.el7.x86_64', java.version: '1.8.0_191'
Driver info: driver.version: SeleniumDriver
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:255)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:237)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:138)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:178)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:146)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:xxxx/status] to be available after 20001 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:102)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
... 18 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:147)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:77)
... 19 more
[DEBUG]   | Timed out waiting for driver server to start.
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'xxxx', ip: 'xxxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.1.el7.x86_64', java.version: '1.8.0_191'
Driver info: driver.version: SeleniumDriver

我不知道这里出了什么问题,我的 docker 映像也与某些版本的 Chromedriver 具有相同的操作系统。我哪里出错了?

此错误消息...

2019-08-26 13:16:30:08S +0100 [SEVERE] onError:Timed out waiting for driver server to start.
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'xxxx', ip: '10.41.39.14', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.12.1.el7.x86_64', java.version: '1.8.0_191'
Driver info: driver.version: SeleniumDriver

。暗示ChromeDriver无法启动/生成新的WebBrowser,即Chrome浏览器会话。

您的主要问题是您使用的二进制文件版本之间的不兼容,如下所示:

  • 您正在使用的 chromedriver = 75.0
  • chromedriver=75.0的发行说明明确提到了以下内容:

支持Chrome 版本 75

  • 大概您正在使用chrome= 76.0
  • ChromeDriver v76.0的发行说明明确提到了以下内容:

支持Chrome 版本 76

  • 您的Selenium客户端版本是3.5.3的2017-08-29T12:42:44.417Z,比2年多。

所以Selenium客户端v3.5.1,ChromeDriverv75.0和Chrome浏览器v76.0之间存在明显的不匹配


溶液

确保:

  • 已升级到当前级别 版本 3.141.59。
  • ChromeDriver已更新到当前的 ChromeDriver v76.0 级别。
  • Chrome
  • 已更新到当前的Chrome 版本 76.0级别。(根据ChromeDriver v76.0发行说明(

相关内容

  • 没有找到相关文章

最新更新