Appearance
I.cancelAlert()
Cancel a native browser alert and closes it.
If no alert is open, the command fails.
INFO
For confirm() and prompt() alerts, this behaves like pressing the "Cancel" button.
For alert() dialogs, this presses the "OK" button to accept, because alerts only have one button.
Usage
js
I.cancelAlert()Example
js
// open a confirmation dialog
UI.execute("confirm('Are you sure?')")
// cancel the confirmation dialog
I.cancelAlert()This cancels the alert and close it.