WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

前端 未结 29 3441
旧巷少年郎
旧巷少年郎 2020-11-21 07:11

I am trying to launch chrome with an URL, the browser launches and it does nothing after that.

I am seeing the below error after 1 minute:

Unable to         


        
29条回答
  •  时光说笑
    2020-11-21 07:27

    TL;DR: If you are using VirtualBox shared folders, do not create the Chrome profile there!


    I ran into this error under Debian 10, but it did not occur under Ubuntu 18.04.

    In my Selenium tests, I wanted to install an extension, and use the following Chrome options:

    chromeOptions.addArguments(
      `load-extension=${this.extensionDir}`,
      `user-data-dir=${this.profileDir}`,
      `disable-gpu`,
      `no-sandbox`,
      `disable-setuid-sandbox`,
      `disable-dev-shm-usage`,
    );
    

    The issue was that I was attempting to create a Chrome profile under a nonstandard directory which was part of a VirtualBox shared folder. Despite using the exact same version of Chrome and Chromedriver, it didn't work under Debian.

    The solution was to choose a profile directory somewhere else (e.g. ~/chrome-profile).

提交回复
热议问题