How to use retry scope?


I have a download button after clicking the button i will get notification(in IE).

The issur is many of times it doesn’t work in one click, i have to do this click 2-3 times tgen only will get the download notification.

P.S on clicking the button there a loader which appears, until loader gose off wont able to click for that time.


  1. Use Do while loop, create a bool variable “FileDownloaded” and set the value to True.
  2. Use Find element activity in a Do while loop and set the output variable ( out_Downloaded).
  3. Check the InnerText property of variable “out_Downloaded” in If condition whether that contains “Downloaded” string or not.
  4. If yes, then set the variable “FileDownloaded” to False, else put some delay to check again.

On variable “FileDownloaded” value to false, it’ll come out of the loop. Let me know incase of any doubts.

1 Like

Retry Scope has two parts:

  1. Action-Perform action.In your case Clicking the download button.
  2. Condition: Put COnditional commands like Element Exist or Find Element.

No oF retries: How many time you want to retry
Retry Interval: Time interval between one retry to another rety.

Once the part in action(click download) is performed , the bot will check the condition(element exist Download notification) and if the condition is false it will wait for the time you mentioned in “Retry Interval” property.Post that it will again perform the action part.

It will come out of retry scope when the retry reaches “No of Retries”(you mentioned in the properties

1 Like

I had tried this but seems like its not working, do u hqve any sample done? Do you mind attaching that sample workflow.

1 Like

Okay, ty @singhonkar, do you have any demo done? If yes do you mind attaching that?.

This is a snippet from some of my code where an application has some randomness where the click potentially failed.

Delays can be on zero. The Element Exists would be the next element which you are waiting for after the click.

I don’t recommend using a Do While for this type of actions, because there’s a chance the loop can never exit, therefore you would need added code so it can exit after a certain amount of time.

If the Retry scope isn’t solving your issue, then there is a problem with your Click activity probably. Maybe try using Simulate Click too; some applications react differently when the mouse needs to move to the position, and Simulate Click doesn’t require mouse movement.


1 Like

Also, in that snippet, the Element Exists has a timeoutMS of 30000 so it waits for the next element that long before it tries to click again.

1 Like

@ClaytonM ty.

The issue is, when i use the element exist on the notification of download, and indicate it I get the selector for the same and it says Valid, which is good, now when i close that notification on the browser, I was expecting to get invalid message but instead still i am getting Valid, I used Highlight to cross verify but still get stunned that is still able to highlight the area but there was nothing.

Do you have any suggestion for that?

I am attaching screenshot.

1 Like

Yeah, I understand because that notification gets hidden in the background. I’ll check to see what I did on a process that has that notification, and get back to you.


That will be a big help, as just because of this, even i am failed to get a proper fix for the next event that is saving the downloaded item, and for that instead for element exits or element on appear i am using image exist, and that not working so well as of now.

Can u check if that element exist when keet in if activity going to then part when notification is there and else part when notification is not there.
Selector showing as valid is not a issue
Only if it always goes to then part or always goes to else part in.noth cases like notification there or not then it is issue

. Can u check that

What in case of mails, if I need to retry when no mail found.
So the BOT will retry 3 times until it finds the mail thru get outlook mail activity.
Could u guide me a bit how to use this activity

Hey, Here is a detailed article on that :slight_smile: