For exception handling, it can catch a specified exception type in a flowchart or activity, and either displays an error notification or dismisses it and continues the execution. It consists of three main sections:
Drag in the Open Browser activity and enter the URL “https://www.aliyun.com”.
Set a variable list with the variable type List<String>
and the default value is new new List<String>{"Latest Activities", "Products", "Solutions"}
, as shown below.
Drag in the For Each activity and set the variable list as the loop body. Drag in the Try Catch activity.
Double click to open the error catch activity and drag in the Click activity to the tryCatch container. Click the "Latest Activity" element at the top of the specified page and open the selector to replace the Sinfo value "Latest Activity" with the variable "{item}":
Click "Add New Catch" and select System.Exception. Drag in the Write to Log activity and fill it out and output exception.Message + "Switch to Initial Page"
. Drag in the Navigate activity and enter the URL "https://www.aliyun.com".
Description:
After you click the first element of the list in the try container, the current page will jump to other pages, causing the loop to fail when clicking other elements of the list. Thus, we set the Jump to Initial Page in the catch to initialize the page so that other elements in the list can be clicked as normal.
Run the flow to view the results: