How to select any item of a list box?

Hello,

I want to select any item of a list box. Never mind which one of them.

How could i do it?

Thanks!

Hello @pal1910

Did you try use the Select Item Activitie?

Yes, but I want to use any item without knowing the values of the dropdown list

Thanks!
@ dkollyns

You can select the field and send a Hotkeys with the Function “Down”

You can use Type Into Activity. In Input, give the list item followed by Enter.

I think I posted this snippet in another thread as well.
Typically, a good way to select items dynamically is to first get all the items stored in an array or list. Then, you can choose any one of them based on criteria.

However, sometimes it depends on how the list box can be interacted with. If the Get Attribute activity works then that is the ideal way.

Here is an example where variables is an Array Of String:
image

Hope that helps.

EDIT: also to the point of other suggestions if you just want to randomly select an item, then use a Click or Keystroke activity on the element

Regards.

5 Likes

Thanks a lot.