Automation QA Testing Course Content

Selenium Issues and Solutions

 1)while launching the chrome browser, the application URL is not opening and thrown below error

org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:65230/devtools/browser/f9347ed5-d12f-4d7d-8260-fc7c9f9394d4 Build info: version: '4.8.1', revision: '8ebccac989'

14:29:11  Dec 07, 2021 1:28:54 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
14:29:11  INFO: Found exact CDP implementation for version 95
14:29:11  Dec 07, 2021 1:29:04 PM org.openqa.selenium.remote.http.netty.NettyWebSocket lambda$new$0
14:29:11  WARNING: connection timed out: /x.x.x.x:4444
14:29:11  java.net.ConnectException: connection timed out: /x.x.x.x:4444
14:29:11  	at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:179)
14:29:11  	at org.asynchttpclient.netty.channel.NettyChannelConnector$1.onFailure(NettyChannelConnector.java:108)
14:29:11  	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:28)
14:29:11  	at org.asynchttpclient.netty.SimpleChannelFutureListener.operationComplete(SimpleChannelFutureListener.java:20)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
14:29:11  	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
14:29:11  	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:262)
14:29:11  	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
14:29:11  	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
14:29:11  	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
14:29:11  	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
14:29:11  	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
14:29:11  	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
14:29:11  	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
14:29:11  	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
14:29:11  	at java.base/java.lang.Thread.run(Thread.java:866)
14:29:11  Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /10.42.2.196:4444
14:29:11  	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
14:29:11  	... 9 more
------------------------------------------------------------------------------------------------------------------

Solutions:

Create chrome option class object and pass into your ChromeDriver class like below:

ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
ChromeDriver driver = new ChromeDriver(options);

Reference Links:https://github.com/SeleniumHQ/selenium/issues/10117
https://stackoverflow.com/questions/75680149/unable-to-establish-websocket-connection
=========================================================================================