A Scope lets you logically group interactions and automation actions, and
also define exceptions using a fault handler.
You can manage a group of actions and fault handlers with a Scope to configure
local exception handling for a robot agent. The Scope logic can be nested at any level
and can be added to other container actions or flow controls such as Frame, foreach, and
switch.
Use Case
You want to open an application from a browser, enter search text, click
Search and wait for the search results to be displayed. You have added an Alert
action if there is an unexpected browser pop-up dialog box before the search text is
entered.
However, if the browser pop-up dialog box does not display, then the
robot agent will not be able to proceed and execute the further steps.
You can handle this error scenario by adding a Scope.
Note:
You must use the low-code
capabilities to add this logic to a robot. Keep reading for step-by-step
instructions.
- Open the robot for editing.
- Add the logic to the robot.
- On the canvas,
point to an action, and click
+.
A menu of
available actions appears.
- Select the Flow control tab.
- In the list, select Scope.
A Scope action appears on the canvas.
- Name the Scope action.
- In the panel, enter a Name and
Description for the
action.
- Select OK.
- Add one or more actions to the Scope.
- Point to the Scope, and select the > button
to expand it.
The Scope expands, and a plus sign appears in it.
- Define actions or logic that the robot takes if there is an exception.
Add a message alert if the robot agent comes across an unexpected
browser pop-up dialog box.
- In scenarios where the unexpected browser pop-up dialog box is not displayed,
the robot agent will fail and not be able to proceed further. To avoid this, add
a fault handler to handle the exception and continue executing the next
steps.
- Within the Scope box on the canvas, point to
, select Fault handlers.
- Select the exception value from the list. This list of exceptions is
dynamically generated at runtime based on the actions included in the
Scope.

- You can also select + Define fault handler and create a new
fault handler or create a default fault handler to handle
exceptions.

- Click
OK.
- Above the
canvas, select
Save.
See the following examples to understand how the robot agent with scope
can handle exceptions.
Example: Robot agent with Scope for handling exceptions
When you run the robot agent, it will handle the exception locally and
continue with the next steps.
Example: Robot agent without Scope
If you have configured the robot agent without a Scope, it will stop
when it encounters an error and not execute the next steps.