I’m running WebDriver tests in Ruby and I’ve got a problem with closing Internet Explorer browser: when I suppose to close browser’s window, IE pop-ups with the prompt “Are you sure want to leave this page” and two options are available “Leave this page” and “Stay on this page”.
I’ve tried several methods for closing browser, both without success:
driver.quit
driver.close
Also WebDriver doesn’t recognize this pop-up as JavaScript pop-up so
driver.alert.ok
driver.switch_to.alert
methods are also not applicable.
I’m using IE9 and IEDriverServerx86 v. 2.24.2
I appreciate any help you can provide
You need to suppress the
onbeforeunloadevent first: