A way to have the robot not proceed with actions until a certain conditional meets a criteria - Do While

Hi everyone,

I am generating a report from a UI (no way to access the server in which these reports are generated) and often when I generate the report, it takes a number of minutes until the report for the appropriate date shows up.

As follows:

  1. Bot clicks on Generate Report - Already Automated
  2. Bot searches and makes appropriate selection for report - Already Automated
  3. Bot scrapes the date from the previous generated report and compares to today’s date - Already Automated
  4. Bot proceeds to right click ellipses of correctly matched date of download report file and save and download - Already Automated

Predicament: Often times, after selecting Generate Report it can take several unknown minutes for the correct report to show up. I’m having trouble solutioning a way for it to WAIT to download until the correct report shows up.

I have the dates compared correctly, but a way to either simotaneously refresh the page and waiting for the correct report to finally show up. Multiple users use this same UI, so sometimes there is a delay when other users are using it to grab different reports which puts it in a que.

Any ideas?

1 Like

Hey @ajeffers

If we can match the title of the report with some business logic or comparing date to identify the latest report will help. We can calculate the same use that in a selector dynamically with a variable.

Hope that helps.



There are two ways with which we can solve this

  1. We must rely on a unique element like a button or a field that will appear once click on generate button
    With that we can see whether that element exists or not using ELEMENT EXISTS activity and keep that element exists inside the condition block of RETRY SCOPE activity
    Put all the other activities inside the action block of retry activity


  1. If there is no unique elements in this Ui on clicking generate button then we must look for a value that can tell us that it’s a new one

As you said you will compare with date and time
I could see a column with date

So once If we click generate button it will load for sometime and show us the report with today date

There use a While loop and inside the loop use a GET TEXT Activity and get the first cell value of that date column
And then check whether the date is a current date or not

If yes then do the next set of steps

Hope this would help you

Cheers @ajeffers

1 Like

@ajeffers You are searching for report and it takes long time to show the correct report. If this is the case, then you can use element exists activity. Follow the below steps

  • Take element exists activity
  • select the correct report name using element exists
  • Check is there any aaname present in the selector. This you can do by opening the selector in UiExplorer
  • If it present then enable that into your selector and pass the aaname value through the variable every time which contains report name. This we called dynamic selectors

Note : The variable contains the name of the report that you are looking for

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.