问题
I am trying to run a selenium headless test on google compute engine with centos 7. I have installed chrome browser 71 using rpm file and the location is /usr/bin/google-chrome. Tried running test with Chromedriver 35,45 but no success. `
System.setProperty("webdriver.chrome.driver","lib/chromedriver");
ChromeOptions options = new ChromeOptions();
options.addArguments("headless");
options.addArguments("window-size=1366,768"); //window size hardcoded set to desktop
driver = new ChromeDriver(options);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
Following exception observed:
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 /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)`
来源:https://stackoverflow.com/questions/60274116/selenium-webdriver-exception-chrome-failed-to-start-exited-abnormally-on-cent