What is difference between while loop and retry scope?

What is difference between while loop and retry scope ,can we give millisecond time interval in retry scope

Hi @anil_mudiraj

While Loop

  • Purpose: Executes activities repeatedly while a condition is true.
  • Use Case: General repetition with a clear exit condition.
  • Structure:
    • Condition: Boolean expression.
    • Body: Activities to repeat.

Retry Scope

  • Purpose: Retries activities until a condition is met or retries are exhausted.
  • Use Case: Handling transient errors.
  • Structure:
    • Action: Activities to attempt.
    • Condition: Success check activities.
    • Retries: Max retry attempts.
    • Interval: Wait time between retries.

Hope it helps!!

@anil_mudiraj

While loop:while is used to loop until the condition becomes true.
Retry scope:Retry scope is used when there is a chance of exception or not able to click the target element or closing of some application the bot retry that particular activities multiple times.the default times are 3.
In while condition if the bot faces any exception the bot stops there only.

Hi @anil_mudiraj ,

Retry Scope:

  • Purpose: Attempts to execute activities and retries them upon failure for a specified number of attempts or until a condition is met.
  • Use Case: Use when you need to handle transient errors or temporary issues, such as network glitches or temporary unavailability of a resource.

While Loop:

  • Purpose: Repeats a sequence of activities as long as a specified condition is true.
  • Use Case: Use when you need to perform an action repeatedly until a specific condition is met.

Regards
Sandy

hi @anil_mudiraj ,
You can try that

Regards,

Thank you all,How can we give milli secs in time interval of retry scope

@anil_mudiraj

retryInterval = TimeSpan.FromMilliseconds(500) ' Retry interval of 500 milliseconds (0.5 seconds) 

Regards,

It’s not possible to give the Retry interval in Milliseconds, the Retry field in the properties of Retry scope activity will accept only seconds, you can check the below image for better understanding… @anil_mudiraj

If you want to give milliseconds you can convert the milliseconds to seconds and give that value in Retry interval field, For example, If you want to give 30 milliseconds then you can give it like 0.03

Or you can give this expression Timespan.Milliseconds(30) in the Retry interval field.

Hope you understand!!