Much like every site on the internet, we use cookies to help analyze traffic and improve our website. As outlined in our privacy policy, any information is only used internally and is not shared with outside organizations.
Learn More

Web Alert

Overview

A Web Alert represents a popup control displayed by a web page. Alerts display a message, have one or more buttons used to close the alert, and optionally prompt you for input.

Topics:

Working with Web Alerts

Since a Web Alert blocks interaction with a page while it is displayed, it is important to handle alerts when they are displayed by a page or playback may fail. For any Activity that expects you to identify an element, refer to the Identification Techniques topic for how to indicate the target element of the Activity will be the Web Alert.

ScenarioInstructions
Closing an Alert Two Activities are available to close an alert: Accept alert and Dismiss alert. For alerts that have only a single button, there is no difference between Accept alert and Dismiss alert. When two buttons are present, Accept alert will indicate the "affirmative" response, and Dismiss alert will indicate the "negative" response. For example, the following shows how Accept or Dismiss correspond to different button combinations:
  • OK (Accept) - Cancel (Dismiss)
  • Yes (Accept) - No (Dismiss)
  • Leave this page (Accept) - Stay on this page (Dismiss)
Both the Accept alert and Dismiss alert activites are specifically designed to work with a Web Alert element, so you do not need to specify the Web Alert Element Identification.
Answering a Prompt When a prompt-style alert is displayed, you input a value into the prompt using the Set value Activity with the Web Alert Element Identification.
Setting the value for the prompt will also close it, so you do not need to accept the alert after setting the value.
Verify message displayed To verify the message that is displayed on an alert, use the Verify property value Activity with the Web Alert Element Identification. Specify the text property as the value for the Name argument of the Activity Call. Use the remaining arguments to define the conditions for the verification.

Identification Techniques

The Web Alert Element Identification technique is the only technique needed to identify a Web Alert. It always refers to any alert that is displayed by the current browser page. Use this technique for any Activity that requires you to specify a target element when you want to interact with a Web Alert. Refer to the Element Identification topic for more details on how to define the identification technique for an element.

Properties

The following properties are available when working with a Web Alert:

Property NameDescription
textThe message displayed by the alert. (Read-only)