Chromedriver 在 Jenkins 上失败 (Linux)

Chromedriver failing on Jenkins (Linux)

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

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 的默认实例,但失败了。以下消息也显示在日志中,这让我很困惑。 driver 似乎正在打开,但立即停止?

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,我还检查了加载它所需的所有环境变量并且确实可用在实例化期间。

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

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