Execute Javascript Alert Disappears

I use this work-around; not pretty but does the trick for me… Displays the same Alert 3 times so user can read the Alert

WebUI.openBrowser('')
def iCnt = 0
while (iCnt <= 3) {
    WebUI.executeJavaScript('alert(\'==> Java Alert Message <==\')', null, FailureHandling.OPTIONAL);
    Thread.sleep (1000);
    iCnt++;
}
WebUI.closeBrowser()
1 Like