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.
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.
|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: |
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 |
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.
The following properties are available when working with a Web Alert:
|text||The message displayed by the alert. (Read-only)|