I am working on MacBook. Our Jenkins server is running in linux server when I running tests via testing.xml file all test classes are running but when I run Jenkins
public static String osDetector() {
String os = System.getProperty("os.name").toLowercase();
if (os.contains("win") {
return Windows;
} else if(os.contains("nux") || os.contains("nix") {
return Linux;
} else {
return "OtherOs";
}
}
// under the openDriverMethod
ChromeOptions options = new ChromeOptions();
if (osDetector.contains("Windows") {
System.setProperty("webdriver.chrome.driver", "driver folder path");
} else if(osDetector.contains("Linux") {
System.setProperty("webdriver.chrome.driver", "driver folder path");
//you need to add this one i guess!
options.setBinary("/usr/bin/google-chrome");
}
My guess - Exactly what the error says, the driver is not executable. SSH into the server and see if
sudo chmod 777 /var/lib/jenkins/workspace/TravelCenterSeleniumJenkinsIntegrationCMB/target/classes/chromedriver
fixes it (777 grants read/ write/ execute permissions to a file for user, group, and others respectively). If you can't SSH in whatever provisions your Jenkins server probably needs to make the file executable on on startup