1

I would like to start selenium browser logged in to one of my google accounts. but it crashes. THis is my code:

    let option = new chrome.Options();
    option.setChromeBinaryPath("C:/Program Files/Google/Chrome/Application/chrome.exe")
    option.addArguments("user-data-dir=C:/Users/adria/AppData/Local/Google/Chrome/User Data/")
    option.addArguments("profile-directory=Profile 8")
    const driver = new webdriver.Builder("chromedriver.exe")
    .forBrowser('chrome')
    .setChromeOptions(option)
    .build()

This is the error I am getting:

    C:\Users\adria\Desktop\project\node_modules\selenium-webdriver\lib\error.js:524
    let err = new ctor(data.message)
              ^

    WebDriverError: unknown error: Chrome failed to start: exited normally.
      (unknown error: DevToolsActivePort file doesn't exist)
      (The process started from chrome location C:/Program Files/Google/Chrome/Application/chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
        at Object.throwDecodedError (C:\Users\adria\Desktop\project\node_modules\selenium-webdriver\lib\error.js:524:15)
        at parseHttpResponse (C:\Users\adria\Desktop\project\node_modules\selenium-webdriver\lib\http.js:601:13)
        at Executor.execute (C:\Users\adria\Desktop\project\node_modules\selenium-webdriver\lib\http.js:529:28)
        at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  remoteStacktrace: 'Backtrace:\n' +
        '\tGetHandleVerifier [0x006CA813+48355]\n' +
        '\t(No symbol) [0x00654FF7]\n' +
        '\tBaseThreadInitThunk [0x77047D59+25]\n' +
        '\tRtlInitializeExceptionChain [0x77DDB74B+107]\n' +
        '\tRtlClearBits [0x77DDB6CF+191]\n'
    }
nevo_e
  • 11
  • 2

0 Answers0