how to loop through all the dynamic list in the website

Hi Team,

I have one task where i need to login to one gov website and below is the website snapshot here i need to first check for the actions (which is dynamic) and after that i need to click on view notices

after clicking view notices the next window will get displayed below is the snapshot

in the above i need to check first if the issue date is not mentioned then no need to click on notice/letter pdf but if the issued on date is mentioned then i need to click on notice/letter pdf i am not sure hw to give a condition and again after clicking on the notice/letter pdf one more window will get displayed as below

after that i need to take a snapshot of above window and need to store it in WordPad and also need to download the pdf file. after this need to go back to the first window where i need to click on next view notices to the same until it completes all the action

how do i achieve this

Hi @bhanu.priya2 ,

Maybe we can work on this By Splitting it into Different Parts, Firstly To Check for the Number of Actions Present.

We can use a Data Scraping and Check if we get the Details. We’ll be able to get the Total Number of Actions Present.

We should then be able to Loop through the number of Actions one by one.

Or Instead if it is easier, we can get the Number of Actions from the Tab For your Actions (39) as indicated in the Screenshot.

yeah we are able to fetch the for your action(40) like this and how do i trim it and also need to convert to integer and please suggest me how do i loop through all the list using for each or wch one?

@bhanu.priya2 ,
To get the Number, We can Simply use the Below Split Method, if the Text format is always the same :

totalActions = Cint(Split(Split(inputStr,"(")(1),")")(0).ToString.Trim)

where inputStr is the String value Output from Get Text Activity, totalActions is variable of Type Integer.

Next, We can use a For Each Activity, In Property we will Specify the Below Expression :


Inside the For Each, we will use a Click Activity. We will Indicate the full Action Box of the First Row as the Element.

Next, we would need to Find an Attribute that would provide us a Means to Dynamically Loop through each action. An Attribute like tblRow which would Indicate that it is the First Element/First Row in that List/Table .

Before Moving Further, we will confirm the Selector from the Click Activity, You Could Post a Screenshot of the Selector Opened in UiExplorer here

where will i mention this Enumerable.Range(0,totalActions)

@bhanu.priya2 , As mentioned, Instead of trimmed, You need to Place the Expression.

okay got it, thank you and please find the below

in the above i have used click activity to click on view notices
in the below i have changed the selector like this, i have created an index as idx and added in the selector

please suggest

@bhanu.priya2 ,

We would require to Create another String variable, say str_Idx.

Inside the For Each we use the Assign Statement and Do the Following :

str_Idx = item.ToString

Now, We can use the str_Idx in the Selector as the value for idx attribute, You could also provide a Default value to the str_Idx variable and Check if the Element gets Highlighted

I have added creating the above mentioned variable as a value for idx attribute but now after adding highlight part is getting disabled not able to identify it…

@bhanu.priya2 ,

Have you tried adding a Default value to the Variable :

Also, We would like you to Select Open In UiExplorer and Indicate the Element again and Send us the Whole UiExplorer Screenshot, to just confirm if we can use other attributes than idx

will the above help to identify?

@bhanu.priya2 ,

Seems that you have Indicated the View Notices Button, then the idx should be fine.

Were you able to Get the Selector to Identify with the Default Value for the idx_str Set ?

okay then where else i have to indicate.

and yeah after giving default as 1 I am able to indicate/highlight the view notice button, below is the screenshot.


Hi, Can you please respond

Hi @bhanu.priya2 ,

Apologies for the late response.

I think we are able to Click on the View Invoices Button now. If that’s so, According to the Below Statement, a new Window will be Displayed.

In that case, we would need to use an Attach Browser Activity and Indicate the New Window/Tab.

Then as per the Requirements, you can Extract the Issue Date first, and Check if it is Not Empty. Extraction of Issue Date can be done using the Get Text Activity.

We’ll move further once you have finished the above methods.