Dropdown selection moves

I have an automation that selects an item from a drop down. UiPath does not recognize it as a drop down so i cannot use the select item activity. I have a click activity for clicking the drop down, then another one to select the specific item. With this field, sometimes the drop down will open going up the page, and sometimes it’ll open going down the page. How do i account for both scenarios in the automation?

Selectors don’t care where something is.

Hello @charlotte.e You can achieve this by using a Click activity to open the dropdown then use an Element Exists activity for the “downward” item selector then use another Element Exists for the "upward” version of that same item then add an If condition like

If elementDownExists = True Click “Item (Down)”

ElseIf elementUpExists = True Click “Item (Up)”

End If

Or making the selector Dynamic like passing the item name in the aaname selector tag or if there is variable the right click in aaname tag then pass that variable so it’ll select the item where the dropdown appears but make sure to remove the idx if present.

@charlotte.e,

I faced a similar challenge recently. What worked for me was using a “Click” activity to open the dropdown, then a “Type Into” activity to search for the desired item (if the search option is available). After that, I used “ Keyboard Shortcuts” activities — first “Tab”, then Enter” — to make the selection. This method can help avoid such issues if search functionality exists.

Let me know your case and how you resolve.

Hi, @charlotte.e
if it does not support search or typing you can try to:

Click to open the dropdown, then use a Find Children activity to get all list items dynamically. Iterate through these items and click the one matching your target…so it works whether the dropdown opens up or down.

@Mir.Jasimuddin not every solution you think is given by LLM kindly go through the solution provided by others.

@charlotte.e

One possible approach I see is using Inject Js Script

Javascript should help in this case

@charlotte.e

Even if the dropdown moves up or down the selector should not be changed so one selector should be working in both cases

cheers