Cannot Call JavaScript When Alert/Confirm Active


#1

You can’t execute code that uses JavaScript (e.g. WebUI.executeJavaScript) WHILE an alert/confirm is active. This is probably true for any browser-controlled dialog.

makeAlertAppearHere()

// You CANNOT call JavaScript here!

WebUI.acceptAlert()

// You CAN call JavaScript here

#JustSayin


WebUI.executeJavaScript() alert in Safari