0

For some reason, my driver start to throw the exception below:

org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:xxxxx/devtools/browser/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

public static ChromeDriver getChromeDriver() {
    WebDriverManager.chromedriver().setup();
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.addArguments("--start-maximized");
    return new ChromeDriver(chromeOptions);
}

I'm able to run my test using Edge driver without any problem, is it possible to be related with configuration problem?

Bruno Prior
  • 131
  • 8

1 Answers1

0

The answer is here: https://github.com/SeleniumHQ/selenium/issues/11750

Appears to related with Chrome 111 update.

I added the argument "--remote-allow-origins=*" and it's working for now.

public static ChromeDriver getChromeDriver() {
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.addArguments("--start-maximized");
    chromeOptions.addArguments("--remote-allow-origins=*");
    return new ChromeDriver(chromeOptions);
}
Bruno Prior
  • 131
  • 8
  • dublicate @ https://stackoverflow.com/questions/75718422/org-openqa-selenium-remote-http-connectionfailedexception-unable-to-establish-w – kaliiiiiiiii Mar 20 '23 at 13:18