Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Storing / Counting number of child elements

I am trying to work out how I can count the number of elements that match a certain criteria.

If you refer to the attached picture, you can see that I have an application with numerous nodes.  The node "List 'SysListView32'" has been expanded and you can see numerous child elements titled 'Cheque' or 'Credit'.

My aim is to loop these elements to tally the total number of Credit items and total number of Cheque items.

This list of child items refreshes each time the user selects a new date in the main program, therefore it changes each time the application is launched. The main structure never changes, only the list item elements.

I have two similar ideas:

1) Find the parent element and then store all the child elements to a WA list and then loop it using If Conditions to test the name to see if it is credit or cheque, then add to the running tally etc

2) Find the parent element and then loop the child elements directly in the window structure - so not adding to a WA list first.

Does anyone know if this is possible?

The first option should be possible.

If you need to scroll to get everything into view, the next option is better.

Thanks for the reply, my query is though, how do I actually do it? I can't work out the correct actions to use in order to loop through the elements...

Find me on LinkedIn and I can show you

Login or Signup to post a comment