How to handle the situation when the browser crashes while running the selenium code? | Selenium Forum
S
Sundaram Iyer Posted on 06/09/2021

While browsing through the products on amazon, the browser automatically closed(or crashed)... so how can we handle crash of a browser using selenium code?

web browser that the selenium automation code invokes crashes while selecting an item from the cart. so for example, we like a shirt and we select the size from the drop down and that's when the browser crashes...

 

I tried to catch "WebDriverException" but it did not do anything. So any idea in general what we can do in selenium if the browser crashes while performing automation?

 

Thanks again


A
Ashish Thakur Replied on 15/09/2021

You get NotConnected exception when browser crashes

Just check that exception first

You can catch that exception and report