For Each name in the Drop Down list

Hello Forum,

Today I’m working on a website automation, and I have to iterate through each name of the drop down list

image (5)
image (4)

What would you do?

I would use For Each UI Element. Designate the pulldown as the main element, and filter on the OPTION tag. This will loop through the options, and you can then do things like Get Attribute to get its value, use the element reference to click and type, etc.

Hello @postwick
Could you explain me more in detail? I thought about that but, how do i get the elements where the robot has to loop from? What do you mean"filter on the OPTION tag"?

Sorry, I was thinking of a different way to do it. For Each UI Element doesn’t have a filter the way the old Find Children activity did.

Hi,

It depends on structure of the dropdown. If the dropdown is simply HTML Select element, GetText with Fulltext scraping mode (Modern) or GetFullText activity (Classic) returns string which has all the option as the following, then split it by linebreak and we can iterate it using ForEach.

Regards,

1 Like

I will try this as soon as possible

Hello @Yoichi
I used both get text and any of those is getting the inner text of the drop down element. Where should instantiate the indicate element?

Hi @Luis_Fernando,

May i know, have you tried “Select Item” Activity

Thanks,
RajKumar

Yes, it doesn’t work

HI,

If it’s simple HTML Select element, either of the following element pointed by red arrow will work.
Or find it using UiExploere whether there is Select element.

image

If it doesn’t work, probably this dropdown doesn’t consist of Select and Option.
So can you share selector string of dropdown and each option using UiExplorer?

Regards,

Try Get Full Text (tick hidden text), and split the text of newline and save it as List type then
use for each to select each of the list item ?