Skip to content

verifyNotAlert (UI Automation - Interrogation)

  • Purpose
  • This command verifies the absence of an Alert, or fail if there are any alerts. Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not consume it with getAlert, the next Selenium action will fail. Under Selenium, JavaScript alerts will NOT pop up a visible alert dialog. Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case, a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.
  • Syntax
  • verifyNotAlert(pattern)
  • Target
  • pattern - The alert message to be verified.
  • Value
  • N/A
  • Return Value
  • Pass, if the alert message doesn't match.
 
 
 

Feedback and Knowledge Base