lundi 17 février 2020

trying to perform selenium testing using chrome driver but facing issue with below error while executing in cli as headless browser

<<< FAILURE! 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.)

  • both google-chrome and chromedriver are installed under /usr/bin/*
  • code sample

    System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setBinary(System.getProperty("user.dir") + "/usr/bin/chromedriver"); chromeOptions.addArguments("--no-sandbox"); chromeOptions.addArguments("--disable-dev-shm-usage"); chromeOptions.addArguments("--headless"); WebDriver driver = new ChromeDriver(); driver.get("file:///" + destFilePath);

Aucun commentaire:

Enregistrer un commentaire