Add an Alert Action
The alert action allows a robot to interact with a browser alert dialog box. For example, the robot can click OK or Cancel in the dialog.
Use Case
A browser alert dialog box prevents you from interacting with a web page. You must interact with the dialog first. The alert action allows a robot to interact with the dialog and optionally capture the message in the dialog.
A browser alert dialog box always contains an OK button and sometimes contain a message, Cancel button, and text field.
Add an Alert Action
Note:
You must use the low-code capabilities to add this action to a robot. Keep reading for step-by-step instructions.- Open the robot for editing.
See Open a Robot.
- Add the action
to the robot.
- On the canvas,
point to an action, and click
+.

A menu of available actions appears.
- Select Alert.
An Alert action appears on the canvas, and the Alert panel appears.
- On the canvas,
point to an action, and click
+.
- In the panel, enter a Name and
Description for the
action.
The Name appears on the action in the canvas and should help you and others understand the goal of the action.
- From Operations, specify how the robot interacts with
the alert.
Operation Type of browser alert dialog box Description Message Alert
This operation interacts with a dialog that contains only one button: OK.

Use this operation to select the OK button.
Confirm Alert
This operation interacts with a dialog that contains OK and Cancel buttons.

Use this operation to select the required button.
Prompt Alert
This operation interacts with a dialog that contains a text field, OK button, and Cancel button.

Use this operation to enter text and select the required button.
Is Alert Present
This operation interacts with any of the previous dialogs.
Use this operation to check one of the following conditions:
-
A browser alert dialog box appears.
-
A browser alert dialog box appears and contains a specific message.
If the condition that you check for occurs, the operation returns True. Otherwise, the operation returns False.
-
- On the Input tab, specify how the robot interacts with
the dialog box.
The Input tab isn't available for the Message Alert operation; this operation always selects the OK button.
-
Text: (Visible only for the Prompt Alert and Is Alert Present operations; always optional) Enter an appropriate value:
-
For the Prompt Alert operation, specify the text for the robot to enter into the text entry field.
-
For the Is Alert Present operation, choose the information that you want to get from the action:
-
To confirm that a specific message appears in the dialog, enter the message that you expect. If the dialog contains this message, the operation returns True. Otherwise, it returns False.
-
To confirm that a dialog appears, don't enter any text. The operation returns either True or False, depending on whether a dialog appears.
-
-
-
Action: Specify the button that the robot selects.
-
Accept: The robot clicks OK.
-
Dismiss: The robot clicks Cancel.
-
Leave: The robot doesn't click any buttons. Use this action with the Is Alert Present operation, when you're checking whether a dialog appears or contains specific text.
-
-
- (Optional) Save the message from the dialog to a variable.
- Select the Output tab, if it isn't already visible.
- Click within the Save to field, and select
Variables
.The Variables panel appears.
- Determine whether the variable that you need appears in the list. If not, create it. See Create a Variable.
- Select the variable to assign the value to, and drag it to the Save to field.
- Click OK.
- Above the canvas, select Save.