How to fix org.openqa.selenium.remote.http.WebSocket$Listener onError with Selenium WebDriver | BDD

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back I'm Ragin Mishra and I welcome you all in this video we will be fixing the org. openen keyway do selenium do remote. HTTP websocket listener on error there's a warning connection reset and the exception called socket exception connection and reset all right so we will know the root cause of this issue and we will fix it so this is my um cucumber test Runner class and uh wherein I have written the in this I mean here this is the bdd framework cucuma framework and I have written the feature file and the step definition accordingly so as in when I run this it will look out for the feature and the respective step definition so let me run it and uh see if I'm getting that websocket error or not see I have come across I mean this this websocket listener on error issue right now uh it is it is uh quite annoying as in um all the test are completed but um since you are seeing like U then user in navigator to home to the homepage so if I have to go to this space Factory and you may see that everything is executed fine and when we come or the control comes to this part closing the browser okay this is occurred um during this um method execution okay so the root cause for this error is like the socket is not closed properly web socket is still open and as in when you are um um you are executing this is I mean this flow you are executing this class step definition um since the it it won't get the uh socket as such when you are closing it so instead of this instead of this what we can do we can uh try driver. quit instead okay so when we use quit it will make sure that the driver I mean is quit properly all right so now let me let me run it again to see if this error is gone or not see this error is not there okay so let me tell you let me tell you if you use uh this driver. close again you may not see this error you may not see this error for the first time execution okay this issue by the way is intermittent this may happen if you are using driver. close instead of driver. quit okay okay you can see but if even if you don't see uh uh then issue is basically is is or can be fixed with the can we fixed with driver dogit okay all right now as I said what you have to do you have to use driver. quit as in when you see this web socket listener on error okay let me run it again and see if it is we are just trying to you know double check cool so now you are getting a proper you know the Gin syntax like your execution is proper and you are not seeing that web socket uh a listener on error which was very annoying error right on the console and you can also see your test output here if you refresh you will get your index or you have to yeah since we are generating HTML report. HTML so you should see if the test execution was also so fine see last one was 48 second ago so we are able to execute all the test and we are able to close the browser as well okay all right then that's it from this video and I hope you have liked the explanation and learned from this video please do like and subscribe to my channel and uh share it with your friends and also share the feedback in comment section and I will see you in next video till then keep learning and thanks for watching
Info
Channel: SDET Adda For QA Automation
Views: 4,933
Rating: undefined out of 5
Keywords: org.openqa.selenium.remote.http.WebSocket$Listener onError, WebSocket, WebSocket$Listener, WebSocketListener, SeleniumWebSocketListener, selenium webdriver, webdriver tutorial for beginners, webdriver issues solved, selenium4, Cucumber, BDD, sdetadda, Raghavendra Mishra
Id: g5ymn4SeOlg
Channel Id: undefined
Length: 5min 2sec (302 seconds)
Published: Fri Oct 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.