Issue
So I have a regression suite using Java/Selenium etc which runs fine headless on my local PC. Now I am trying to create a build configuration on our TeamCity server and within the code I have this little snippet -
if(IsOnTeamCity()) {
System.setProperty("webdriver.chrome.driver", "_drivers/chromedriver");
}
else {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\\_drivers\\chromedriver.exe");
}
and
private static boolean IsOnTeamCity()
{
String environmentVariableValue = System.getenv("TEAMCITY_VERSION");
if (environmentVariableValue != null && !environmentVariableValue.isEmpty())
return true;
return false;
}
When I start a run all works well until we get to the tests.
Then I get this error
[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
So am I setting webdriver.chrome.driver up wrong? Or is there other settings I need to look at please?
Solution
chmod 755 cured this problem for me
Answered By - Kev