I'm automating tests on a web page which pops an Alert window upon clouser using driver.close()
.
The alert is for confirmation asking if i'm sure and exposes "stay" or "leave" buttons.
Now, when driver.close()
is executed, the popup shows and driver.close()
is "stuck", waiting for response, BUT I cannot executed driver.switchto().alert()
to response (accept()
or dismiss()
) since the driver is waiting...
Working with additional thread didn't help.
Eventually, after a long timeout, close throws an exception....
Any ideas? It is so trivial scenario, yet very hard to deal with from code with selenium api.