【发布时间】:2019-02-19 12:06:44
【问题描述】:
我有在 Linux 机器上运行的 jenkins,每当我尝试运行以下脚本时,它都会失败并说驱动程序不可执行。
java.lang.IllegalStateException: The driver is not executable: /COMPLIANCE-48/workspace/AutoProfile_Exec/Driver/chromedriver
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
代码:
String getLocation=System.getProperty("chromePath");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
System.setProperty("webdriver.chrome.driver",getLocation);
WebDriver iDriver = new ChromeDriver(chromeOptions);
下面是mvn命令:
-U clean compile exec:java -DchromePath="${WORKSPACE}/Driver/chromedriver"
实际上,我已将 chromedriver 放在该特定路径中并将其作为参数传递。但不知道为什么它说驱动程序不可执行。
【问题讨论】:
标签: linux selenium jenkins selenium-webdriver selenium-chromedriver