Need help to resolve broken Find Children logic in script

Hello,

Recently a crucial part of one of my scripts stopped functioning and I haven’t been able to resolve the issue. I use the Find Children activity to create an enumerable object that filters for a specific button type on a webpage. Then I loop through this enumerable object and use the same find children activity to create an idx value so the robot can keep track of how many buttons exist and which button will be clicked on the next loop.

The logic was working last Friday, but no longer works as of today. When going through the debugger the enumerable object returns “0” so either my filter or the selectors are bad now. I’d love another pair of eyes to help me debug this. I’ll attach a simplified version of the logic after I post this.

Thank you in advance for any help!!

UHC_Example.xaml (19.7 KB)

Here’s the simplified logic!

Hi @Justin_Cho - What is the button that you are trying to keep track of and which button you are trying to click in for each

The bot keeps track of the “View plan details” on each div that contains Medicare Advantage Part C plan information.

I use Find children to filter out those buttons from the overall div that contains all the plans for a given zip code, then iterate through the enumerable object and click on each button so the robot can scrape plan data.

It was working fine last week with the given selectors but no longer finds any with the current properties.

You don’t need to do this. What you want to do is loop directly over the UI Elements, and use the loop variable as the element in all your click, type into etc activities so that you don’t have to bother with selectors. This is much more reliable than trying to count stuff manually and build selectors. In fact, if you just use the modern For Each Ui Element activity, this is all handled for you:

If you’re not on modern (which you should be) then you can do the same thing with Find Children and then a regular For Each to loop through the Ui Elements.

This worked thank you! Didn’t even realize I’ve been developing in classic. The modern ui activity works perfectly!

1 Like

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