How to identify list of selectors and then iterate ui events to them one by one?

I want to perform an operation where I have an ui element with certain selector, say for example:
“webctrl id = ‘elements*’”

Now I have 4 such elements in page like this:
“webctrl id = ‘elements-01’”
“webctrl id = ‘elements-02’”
“webctrl id = ‘elements-03’”
“webctrl id = ‘elements-04’”

these all elements are a dropdown clickable elements and I want to iterate through all such selectors found on a web page and then drop down and collect the dropdown text from each of them one by one. I have figured out a way to collect the dropdown text but I don’t know how to get an array of selectors (or something similar to that) so that I could use them to iterate through them one by one. Does anyone know a way to do so? I am using UIPath Studio.

1 Like

when you capture an element you can get the selector here

for each selector add them to a list


Then loop through the list, if you want to read the text for each of the these selectors just use “Get Text” and pass in the selector to the selector attribute

1 Like

Hey @spidey,

That’s the cool stuff.

Try using Find Children activity for achieving the same.

PFA - FindDropdownElems.zip (2.2 KB)

Thanks :slight_smile:

2 Likes

Hi @Nithinkrishna Thank you very much for your solution. Just wanted to know how to click on those selectors once they’re located? Like something like for each selector click that selector.

1 Like

Use for-each to iterate the collection, use click activity inside by passing foreach item to the element property of click activity.

Thanks :slight_smile:

Hmm here’s the problem I am facing. Actually the container has lots of other elements as well. I want to filter the elements based on the condition that it’s selector must have the attributes I am looking for. For example the selector must have “wctrl name = “Info”” and id keeps changing. So I want to filter all the occurences that have name attribute equal to Info. Can you suggest something for the same?

1 Like

If you can check the filter property in find children, we are currently filtering a web element having the id attribute as u mentioned earlier.

Feel free to add more attributes
<webctrl id='element*' name='Info' />

Thanks :slight_smile:

1 Like

I see thanks again :slight_smile:

1 Like

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