How To Use Retry Scope Activity – In UiPath

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.

UiPath Retry Scope Activity Example 1UiPath Retry Scope Activity Example 2

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.

UiPath Retry Scope Activity Example 1UiPath Retry Scope Activity Example 1.1.PNG

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.

UiPath Retry Scope Activity Example 4.PNG

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.

UiPath Retry Scope Activity Example 5.0

Note:
UserName: admin
Password: password

UiPath Retry Scope Activity Example 5.PNG

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.

UiPath Retry Scope Activity Example 6.PNG

For now, we will consider the UiPath(Blue colored text) element appearing at the top as our condition!!!

UiPath Retry Scope Activity Example 7.PNG

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… 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: