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.
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.