1

I have two different automation frameworks that both make use of the Chrome driver. These frameworks do not exactly directly access Selenium (they are Appian based) but I have suddenly (beginning today) found that none of my tests work and I get the same error every time. I am sure that the driver is up to date.

org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:50576/devtools/browser/12acb1c1-5b1c-46c2-7501-a8958019eb0f

To give a little bit of context the Appian framework handles the Selenium driver in a back-end class/method that I have no control over known as "CucumberBaseFixture."

Within my Cucumber step definitions I simply call the driver like such

Given I setup with "CHROME" browser

as Appian has already created all of the step definitions within their automation framework jar.

Further, I actually set the URL directly using another pre-configured step as such (I have redacted the exact URL due to corporate security.

And I set Appian URL to "REDACTED BUT 100% VALID URL"

I have verified that my necessary configuration is correct for the driver which is not difficult considering they have a script that sets the configuration parameter for you.

Once I execute the test then I get the following stack as well which I find interesting and then the chrome window opens for a moment, closes and the test ends.

ChromeDriver was started successfully.
Mar 13, 2023 4:22:09 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Mar 13, 2023 4:22:09 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Invalid Status code=403 text=Forbidden

Thank you for any help.

jesric1029
  • 698
  • 3
  • 10
  • 33
  • Does this answer your question? [Selenium ChromeDriver returns 403 errors on build server](https://stackoverflow.com/questions/72753290/selenium-chromedriver-returns-403-errors-on-build-server) – Alexey R. Mar 14 '23 at 12:16

2 Answers2

1

Something may be wrong with the latest Chromedriver release. I'm running into the same issue.

Chromedriver bug reports can be found here.

https://bugs.chromium.org/p/chromedriver/issues/list?sort=-id

Daniel Moore
  • 73
  • 2
  • 8
  • 1
    It ended up being a problem with Selenium. I opened a ticket with Chrome that was marked as duplicate. That related ticket was resolved as a Selenium bug. The Selenium bug is still unresolved but digging through the comments I managed to find the solution. – jesric1029 Mar 27 '23 at 20:43
1

After a very long investigation including opening a ticket with the link Daniel shared and then looking into a still unresolved Selenium bug, I was able to locate a comment with the current workaround.

First, you must declare the following in your POM:

   <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <version>4.8.1</version>
  <artifactId>selenium-http-jdk-client</artifactId>
</dependency>

Second, you must add the following line of code to your framework. I put mine in my Junit @BeforeClass in my Cucumber TestRunner:

System.setProperty("webdriver.http.factory", "jdk-http-client");

I hope this helps anyone with similar problems.

jesric1029
  • 698
  • 3
  • 10
  • 33