Retry same findElement statement after handling unexpected popup

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Retry same findElement statement after handling unexpected popup

rdntech14
Hello, 

Problem :In my application, there is the unexpected popup shows up on any screen that makes test case fail. I can surround findelement with try-catch for most likely places but it may happen on any screen so this is not a good idea to cover every finelement statement with try-catch. 

Approach :  I would like to have mechanism if findlement is failed at any place due to unexpected pop up occurred, Framework should handle pop up and retry same find element statement one more time and return back to test execution to continue future steps.

After doing some research on Internet, I feel it can be done using WebDriverEventListener and tried but did not work. 

Solution/Suggestion: Can someone please provide me solution or suggestion how this can be achieved. 

I am using Java Selenium TestNG in Framework

Thank you

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7f615474-2e98-4f9d-b76f-44d26bd98eb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.