gpt4 book ai didi

java - Chromedriver 在 Jenkins (Linux) 上失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:27:40 30 4
gpt4 key购买 nike

我正在尝试在 Jenkins 上的 Chrome 上运行 UI 测试,从错误来看,它似乎无法启动。

org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 2.6.32-358.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.54 seconds (user: 'UnknownUser-0', output: '1440016601647')
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'abc.xyz.com', ip: '111.222.333.444', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-358.el6.x86_64', java.version: '1.8.0_05'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:139)...

代码(在 Java 中)只是尝试实例化 Chromedriver 的默认实例,但失败了。以下消息也显示在日志中,这让我很困惑。看起来驱动程序正在打开,但立即停止?

Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 4601
Only local connections are allowed.
[0.422][WARNING]: PAC support disabled because there is no system implementation
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 9515
Only local connections are allowed.

实例化是这样完成的:

WebDriver webDriver = null;
String chromeDriverLocation = MyCustomPropertyReader.getProperty("webdriver.chrome.binary.location");
System.setProperty("webdriver.chrome.driver", chromeDriverLocation);
final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
webDriver = new ChromeDriver(capabilities);

我能够从命令提示符运行 Chromedriver,我还检查了加载它所需的所有环境变量,并且在实例化期间确实可用。

有人可以告诉我我可能遗漏了什么,或者是否有办法获得有关此失败原因的更多信息?

最佳答案

该问题已通过更新浏览器安装解决,并确保 Chromedriver 和 Chrome 浏览器都可以从命令提示符运行。

关于java - Chromedriver 在 Jenkins (Linux) 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32106064/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com