Selenium WebDriver how to close browser popup

0
0

I am writing tests for a web App using selenium webDriver and came across a scenario where when I try to close the browser I get a popup saying “Are you sure? The page is asking you to confirm that you want to leave – data entered will be lost.” with 2 buttons: Leave Page and Stay on Page

How do I click on those buttons?

  • You must to post comments
0
0
 ( ( JavascriptExecutor ) _driver )
.executeScript( "window.onbeforeunload = function(e){};" );

solved the issue for me

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website