Do While loop help



Steps following -
-Select item from drop down and click search(above attached 1st image will appear with records)
100 records will appear in every page
-click Payment Completed in status column to download.
-once downloaded, status will be changed.(see 2nd image).
It will move to next row for download and so on till the last record on the page
after that it will click on search again to load the next set of records
If on clicking search gives result as No Data(see 3rd image) it will logout.

I want to keep all this in a do while loop and the loop will exit only if there is “No Data”(like 3rd screenshot) else it will continue with the records appear on the screen and once all download completed it will click search and so on.

But i am failed to achieve this instead i tried below which is not working as per my exception

I attempted to archive the result but i am lacking.
I tried DataScraping and used For Each Row
in For Each Row body i used IF condition

row(“DC Number”).ToString.Contains(“No Data”)
you can see below screenshot

Thank you

@Palaniyappan can you have a look please.

Hi htere @indrajit.shah

I did not get where you actually failed to achieve this objective but I can give you a bird eye view on how you might achieve this - try it and get back if you have any further queries.

  1. First you should have mentioned what application you are working with. (seems like browser so lets go with that)

  2. Once you are in the landing page you follow the conventional route of searching for the item and click the search button.

  3. Here is the core of the logic - two alternate methods
    a. You can data scrape the table and can find the rows count and if they amount to zero then you have no data, so skip the remaining steps and go to the next item.
    b. Find children of the main parent (table node) and check for descendants and ge the collection count (as data scraping doesnt work as expected unless it is a structured data and preferably a table)

  4. You have a pre- condition that ends the loop when you reach the end of your items collection.

Coming to your workflow - the initial stages are correct and you just need to get the row count of the scraped data table.

hope this helps :slight_smile:

@indrajit.shah You can directly use ElementExist Activity where pass No Data in ElementExist

So it will work as :

I don’t think this will work for me, as i have to click search after downloading all the records on the page, as on click search the new set of records will appear if there is any.

The above scenario says that : It will work until u get no record.

So if u have new set of data then in this case it will work the functionality part.

Hope this will help.

its a web app and about login and navigate i had covered it up.

Coming to the main part-
i had tried point 3a earlier and it not worthy in my situation and about point 3b i didn’t get it.

Scraping Data works for me but the condition i had written is may be not what it should be and also as i mentioned i have to keep downloading if i found records on the screen and after i complete downloading the items on the page i have to keep clicking search to load next set of records if any else it will give No Data and then only it will logout or stop anything.

let me clarify it one more time:

  1. From drop-down i will select “Payment Completed (Download The Report)” and will click search,It will return only records having “Payment Completed (Download The Report)” status(refer 1st screenshot from the top), Limited <=100 records will load on the screen.
  2. Once i click downloading, the status will be changed to “Report Downloaded Completed” and it will move to next record and so on.
  3. Now to get more records of the status “Payment Completed (Download The Report)”, i have to click on the same search to populate the next set of records if any else it will return “No Data”

Okay this is great that you clarified the process but I am still clueless on where you are facing an issue? The scraping part, the authentication of data exists part or the looping construct?

The loop construction part.