While automating a business process, the situations where we have to retry a particular failed action or a sequence of failed actions are expected to be there.
“Retry Scope Activity” of UiPath can be effective in handling such scenarios.
It retries the expected activities as long as the condition is not met and throws back an error if it fails to do so.
Note:
1.Action Block – Here we define our actions that we wants to achieve.
2.Condition Block – It is the condition based on which we can decide to retry
Only activities which return a boolean result are supported by Condition Block.
i.e. Element exists,Image Exists…
3.NumberOfRetries – The number of times that the sequence is has be retried.
4.RetryInterval – Specifies the amount of time (in seconds) between each retry.
Example
Implementation using UiPath :
Let us implement a workflow which launches an application called UiDemo, then tries to log in to it.
Step 1:
Drag “Retry Scope” activity into the design panel and supply the required parameter as shown below
Note:
NumberOfRetries is 3, so it will retry 3 times.
RetryInterval is 5 seconds, so it will retry with a gap of 5 seconds between each failure.
Step 2:
Drag “Open Application” activity into the Retry Scope Action Block and try to indicate the Application using indicate on-screen option as shown below.
Step 3:
To “Enter the login details”, drag Required activities into the Do Block of Open Application activity and indicate the respective elements as shown below.
Note:
UserName: admin
Password: password
Step 4:
Drag “Element Exists” activity into the Retry Scope Condition Block and try to indicate some element in the next window that we expect to appear using indicate on-screen option as shown below.
For now, we will consider the UiPath(Blue colored text) element appearing at the top as our condition!!!
Step 5:
Now when we finally run the process, if we by any chance encounter any error while entering the login data, the sequence of steps will be retired as per our defined commands.
If it still fails after mentioned retries, the appropriate error will be shown!!!
Click here to download the Source Code…
Hope it has helped you…