尝试在jenkins机器(Linux服务器)上运行时,出现异常。我尝试了其他方法,但找不到根本原因,将不胜感激。
我正在使用Selenium Java:2.46.0, ChromeDriver 76.0.3809.68
错误:
org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /jenkins/workspace/et-automation-regression/resources/drivers/linux/chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
我正在通过Jenkins在linux服务器上运行此套件。
final ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary(System.getProperty("user.dir") + "/resources/drivers/linux/chromedriver");
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("start-maximized");
chromeOptions.addArguments("disable-infobars");
chromeOptions.addArguments("--disable-extensions");
chromeOptions.addArguments("--no-sandbox");
webDriver = new ChromeDriver(chromeOptions);