org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally已解决

Jenkins执行selenium自动化时,出现如下错误,一定要确保浏览器是隐藏模式启动。
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
​
            ChromeOptions chromeOptions = new ChromeOptions();
			// 禁用沙箱
			chromeOptions.addArguments("--no-sandbox");
			chromeOptions.addArguments("--disable-dev-shm-usage");
		    chromeOptions.addArguments("--headless");
​

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally已解决_第1张图片

你可能感兴趣的:(Jenkins自动化,selenium)