引自:https://blog.csdn.net/dreamtl/article/details/53486563
在eclipse ide中好着的,但集成到jenkins报错:org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
解决方法:
分析:可能是因没有定位chrome浏览器的位置,找不到binary ,所以报错,增加红框语句:
System.setProperty("webdriver.chrome.driver", "files/chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setBinary("chrome.exe路径");
ChromeDriver driver = new ChromeDriver(options);
然后打断点发现:binary是有值的;重启jenkins好了;