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

前端 未结 29 3375
旧巷少年郎
旧巷少年郎 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:32

    It happens when chromedriver fails to figure out what debugging port chrome is using.

    One possible cause is an open defect with HKEY_CURRENT_USER\Software\Policies\Google\Chrome\UserDataDir

    But in my last case, it was some other unidentified cause.

    Fortunately setting port number manually worked:

    final String[] args = { "--remote-debugging-port=9222" };
    options.addArguments(args);
    WebDriver driver = new ChromeDriver(options);
    

提交回复
热议问题