Looping Through Radio Buttons on Webpage

Hello Uipath community and happy Wednesday :slight_smile:,

Today, I have an interesting dilemma for you. P.S. don’t ask if I can share the workflow because I cannot ( contains Non-public information ) so bear with me here as I try to describe the problem to the best of my abilities.

I currently have a page that contains multiple Radio buttons like the screenshot below ( please note that this is an example only). Now for every transactions, there could be a dynamic amount of radio buttons on that page. For example, sometimes it’s 10, sometimes it’s 1, sometimes it’s none.

My goal is for every transaction that the bot processes, to go check if there are radio buttons. If there are then click on every one of them and do some processing until there are no more.

Now I looked using the UiExplorer and I found a tableRow that contains an integer which depicts the row number of each radio button. That is fantastic as I can use that selector dynamically to loop through all of the radio buttons.

My two questions are:

1- Is this the best method to loop through radio buttons on a page? Basically find a unique selector for each radio button and add a dynamic change to it?

2- Before I start looping through the selectors, how would I know how many I have on the page to begin with? meaning, before I start a loop for 8 radio buttons, my robot needs to know how many are on the page before hand. How could I do that ?

Thank you, :slight_smile:

image

@sasho1987

Use FindChildren activity to obtain an IEnumerable of UiElement. You can iterate directly on the children with a ForEach activity.

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