I have a Task that is attempting to close a Chrome browser window but it cannot do so because of a Chrome dialog warning that navigating away from the page could result in loss of data.
- I cannot use recorder to capture this dialog because having it on screen freezes ALL my Chrome windows, not just the one it is trying to close. I can’t even switch to another Chrome window while this dialog is up.
- I’ve tried sending a “ENTER” keystroke to the page but that does not press the “Leave” button that has the focus.
- I cannot use Taskkill to close Chrome because this closes all Chrome windows including my dev windows I’m working, which stops the BOT from running.
- Update: Also tried changing the Chrome Setting to block popups in chrome on this site. That did NOT work either.
If anyone has a work around for this I’d really appreciate it!
Best answer by JMarinoView original
Please try with condition of : If → Window is found in a window(Image recognition)
If found than use key strokes → ctrl + w to close the window.
else → nothing.
After a lot of time on this last night I did finally find something that allowed this to close.
It take 20 seconds for the keystroke to close the dialog and the browser but at least it works.