1

How do I fix this selenium error?

  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location c:\Users\aaron\Downloads\webscraper\chromedriver.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Here is my code:

const {Builder} = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');

(async function openChromeTest() {
    try {
    let options = new chrome.Options().setChromeBinaryPath(`${__dirname}\\chromedriver.exe`).addArguments("--disable-dev-shm-usage", "--no-sandbox", "--headless");
    let driver = await new Builder()less"
                .setChromeOptions(options)
                .forBrowser('chrome')
                .build();
    await driver.get('https://www.google.com');
    await driver.quit();
    } catch (error) {
    console.log(error)
    }
})();

I tried adding --disable-dev-shm-usage --no-sandbox --headless arguments as WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser says to do but that did not fix it.

Isaac W
  • 23
  • 9

0 Answers0