How to handle periodically missing item from the dropdown menu when using Select Item activity?

Hi,

There is an item in the dropdown menu that is missing periodically.
How to handle those situations because I get the error every time the item is missing?

Thanks in advance.

Hi @bp777 ,

Could you try using a Find Children Activity on the Element and then use this to check whether the item is present or not before selecting it?

arr_items.Contains("ItemToSelect") -> Outputs a Boolean Value

You can use the Boolean Value in an If Activity to select the item if it exists, or throw a Business/System Exception to notify the end user that that particular item is not present.

If the item just takes time to load, then use a Do While and keep retrieving the items until it appears.

Kind Regards,
Ashwin A.K

Depending on the type of dropdown an element exists with dynamic selector to the option element from the dropdown select element could be an alternate to find children.

A benefit of find children is that we do have more control when evaluating the found children.

Keep in mind that find children will return uielements. So an evaluation on the value could look like this (check on innertext attribute)

FindChildrenOutPut.Any(Function (x) x.Get("innertext").toString.Trim.Equals(YourSearchValue))
2 Likes

Very true @ppr ,

I missed to mention that, @bp777 please follow the instructions detailed in ppr’s post and do mark his post as Solution if it solves your query!

Kind Regards,
Ashwin A.K

1 Like

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