For Each for Get Children Not Closing/Stopping

Hello again all,

Im currently having trouble in stopping the For Each loop for Find Children activity. The bot would throw error of cannot find the element of rownumber = 5, when in fact the table only have 4 rows. Have tried ElementExists as well and it’s still would not stop the loop?

Please do help and tell me if this error is rooted from Selector or any else?

Hi syezids,
It my be due to findchildren identifying child components you might have not expected it to.
I am just gussing examples like table headers,or other hidden tr/ tds in case of an HTML table.

If you can give a sample screen shot of the loop it would be easy to understand the issue in detail and would be able to guide you better.


yes in fact the table does have headers, and it hold a select all button as well.
basically what i’m trying to do is get the text of each children, and check each of the checkbox too.

and below is the selector for the get text, dont know why it’s in error, but the loop is working fine until the end and then the error of cant find the next element(which does not exist) happened.

Instead of find children and looping through each element why you cannot use Data scraping option to extract structure data from the grid and store it in datatable ? that would be much easier.
And for clicking each checkbox if it is not any condition based you can use a click activity to select all since you have that button on the grid.

yes i thought of that as well, but the clicking each checkbox is actually based on a condition, which is first to click select all, then only the bot checks for just one particular row, and only that row should be checked, including the select all button.

I know this sounds weird but that’s just another needed step for this to work, as there is some constraint on the UI elements on the webpage. Basically the steps are:
click select all > loop through each child > checks if the row is the one’s needed (based on the get text)> if not, uncheck > if the one particular row if found, skip unchecking the row > continue for the next row as we would want to uncheck all not needed rows.

I think for this still would need to use find children right?

ok i found the solution using elementexists, ensuring the selector is right.
thx for helping.

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