Chromedriver 无法在 Teamcity 上执行,存在 linux-agent 问题
Chromedriver is not executable on Teamcity with linux-agent problem
所以我有一个使用 Java/Selenium 等的回归套件,它 运行 在我的本地 PC 上很好用。
现在我正在尝试在我们的 TeamCity 服务器上创建一个构建配置,在代码中我有这个小片段 -
if(IsOnTeamCity()) {
System.setProperty("webdriver.chrome.driver", "_drivers/chromedriver");
}
else {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\_drivers\chromedriver.exe");
}
和
private static boolean IsOnTeamCity()
{
String environmentVariableValue = System.getenv("TEAMCITY_VERSION");
if (environmentVariableValue != null && !environmentVariableValue.isEmpty())
return true;
return false;
}
当我开始 运行 时一切正常,直到我们开始测试。
然后我得到这个错误
[When logged in as a staff member I can see the the navigation cards] java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: The driver is not executable: /opt/buildagent/work/815e6cc9c618cd9d/_drivers/chromedriver
那我是不是把webdriver.chrome.driver设置错了?或者我需要查看其他设置吗?
chmod 755 为我解决了这个问题
所以我有一个使用 Java/Selenium 等的回归套件,它 运行 在我的本地 PC 上很好用。 现在我正在尝试在我们的 TeamCity 服务器上创建一个构建配置,在代码中我有这个小片段 -
if(IsOnTeamCity()) {
System.setProperty("webdriver.chrome.driver", "_drivers/chromedriver");
}
else {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\_drivers\chromedriver.exe");
}
和
private static boolean IsOnTeamCity()
{
String environmentVariableValue = System.getenv("TEAMCITY_VERSION");
if (environmentVariableValue != null && !environmentVariableValue.isEmpty())
return true;
return false;
}
当我开始 运行 时一切正常,直到我们开始测试。
然后我得到这个错误
[When logged in as a staff member I can see the the navigation cards] java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: The driver is not executable: /opt/buildagent/work/815e6cc9c618cd9d/_drivers/chromedriver
那我是不是把webdriver.chrome.driver设置错了?或者我需要查看其他设置吗?
chmod 755 为我解决了这个问题