RPA flow to demonstrate an exception
This example demonstrates an exception that is encountered when working with Web Activities.
- Add an Open Browser activity.
- Configure the activity to open a specific website.
- Add Try Catch activity to the new sequence.
- Add Click activity inside the Try section of the Try Catch activity.
- Specify an invalid XPath in the click activity. The activity times out if the specified element is not found. The Continue on Error check box must be cleared for this activity.
- Click the Catches section and select an exception class from the drop down or click the option. The exception class is based on the exception that the activity displays. For the Click activity, the exception class can be WebElementNotFoundException in the Infro.Activities.Web.Exceptions domain.
- Add an activity or a sequence in the Catch section to decide an action that must be taken when an exception is encountered. For this example drag and drop Message box and configure the text property by adding an “exception.message” text.
- Similarly, add an activity or a sequence to the Finally section of the Try Catch activity. Anything in the Finally section is executed irrespective of an exception.
On running the RPA flow, an exception is encountered and the Message Box in the Catch property is executed to display the. 'Click Activity timeout exception occured with xpath: <invalid path specified in the activity> message