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");
}