Working on drop down lists

uiautomation
studio

#1

I am trying to select an item from drop down list using the data from csv file, my solution is throwing an exception saying:

Message: Cannot select item. It was not found among existing items.
TIP: Some combo-boxes delay load items until its dropdown is expanded. Try to simulate a click on control prior to selecting an item.


#2

See that the data you are extracting from csv file is correct i.e. whether or not that same data exists in the drop down list.


#3

Also, try to trim the data before passing to the select item activity. If it contains extra spaces then also could be chance of such error.

Thanks,
Rammohan B.


#4

It is the same data and if possible can you tell me the procedure how to select an item from drop down list?

Thanks,
Lohitha


#5

Yeah, I tried trimming the data before using it in select activity, but no use, i am getting the same error


#7

You could try these steps:

  1. Hover/Click the combo box/drop down (Use Hover or click activity, whatever works for you)
  2. Use click activity to select an element inside Combo Box/drop down and change the selector to select the element that you are extracting from csv :slight_smile:
    Tell me if that works :slight_smile:

Dynamic item selection from the dropdown list
#8

It worked. But any issue is, there are some items which are not available in the drop downlist, for that case how can I write an exception to just ignore if it doesn’t find the item in the list.

For the information, there is no possibility to just use the items only which are available in the list.

Thanks,
Lohitha


#9

Did you tried using Try Catch?
Place the part of workflow which generates exception inside a tryblock and inside catch perform whatever activity you want to perform :slight_smile:


#10

Trying that now :slight_smile: Will let you know after completing that.


#11

HI, Can you just give me an example. My work flow is initially hover through the list and select a particular item and then click the submit button, This procedure happens for couple of items based on number of rows in excel sheet. And the possibility is all the items in the excel sheet may not be in the list.


#12

Hi @chintham,

A small condition should be implemented to check whether your item from the Excel sheet exists. The moment you try to click based on the invalid selector, UiPath will throw an exception.

In this case, I would suggest something like that:

  1. Hover over the list to activate available selectors
  2. Use activity Element Exists to check if your particular selector from Excel is available (this activity returns a boolean - True if it exists, False if not)
  3. Use that boolean variable in an IF statement to either click on a valid element or log an error message if it is not.

#13

bit3.xaml (10.3 KB)
Hi, Thanks for the suggestion, But is this how you told ? I am getting some errors. Can you please have a look at it and tell where it is going wrong.


#14

Figured out what the issue is.