Our application has a popup alert built-in if user closes the browser tab. It works when I manually close the Chrome browser tab, but when I use Selenium methods like driver.close()
or quit()
, or Keys(COMMAND + w)
it doesn't throw any pop up - but directly closes the browser.
Is there anyway to display that prompt/popup/alert as it is normally thrown on manual run?
I tried all possible ways to close the browser tab, and all those methods directly closing the browser tab without throwing the pop up.
I want the popup to be displayed before closing the browser tab, as it normally appears on manual execution.