Select Item activity for drop down is not working

Hi All,

I am trying to use a select item activity to select a value from the drop down. But it is not working. It says “This control does not support select item”. I want to select the item from the drop down based on the if-else statements. e.g. - if varValue = ‘Ontario’, select “ON Billing”, if varValue=‘Quebec’, select “QB Billing” (just an example). Is there any alternate way to achieve this. Thanks.

1 Like

@harmeet_kaur You can try this

  • Use click activity to open the drop down
  • And use another click activity to click on the element you need
    Also, you mentioned that every time the data changes. For that you can pass the variable in the selector as aaname in the second click activity

This is the selector for my drop down list. I don’t have aaname here. Can you please share any example of this?

@harmeet_kaur is it possible to share the screenshot of how the list of items in the drop down looks like in the application

Here is the screenshot

image

@harmeet_kaur Please check the below screenshot for aaname

Capture

aaname is the element name on which you want to perform an action. If it finds in the selector then the bot can easily identify the elements without any issues

Please find below sample example

UI.zip (5.7 KB)

Were you type the name of the state in the select from list field

@harmeet_kaur Also, can you please do this. Can you select only Alberta from the list using click activity and share the selector

Add a Click activity. Click Indicate Element. Press F2 to pause, and click the pulldown. When it unpauses click one of the items. Now you have a selector and somewhere it will include the value for the item you clicked. Make that dynamic.

Sorry for the late reply and thank you for your answer. So here is the selector that I got and I just need to change the value of aaname to a variable.
Something like this

Am I correct

image

Yes you’ll need to change the value of aaname to a variable. Also, things like WID1648227707807, ivuFrm_page0ivu1, zzzzAIDGLKGG, etc look like things that are likely to be different each time the page loads. You’ll have to test and account for this.

Thanks for your reply. I tried to change the value of aaname to a variable that has some default value set up, but it is not working. It keeps on selected a wrong value from the drop down box.

Here is my selector.

Are you still using Select Item, or are you using a Click then another Click?

I am using click item and then another click item

Are you sure selectedType has the value you think it should have? Put a breakpoint on the second Click and run in Debug mode. When it pauses at that breakpoint, check the pane on the left to see the value of selectedType.

The validate button on the top in UI Explorer is red. So I believe, it means my selector is not correct?

I deleted the id tag and its value in the last line and the validate button turned green.

I tried to debug the click event and the variable is getting the right value. But it is still making the wrong selection from the drop down.

Is the ID the same for all the select options? You need to look at the selectors for each item and figure out what’s consistent and what isn’t.

There are differences in few. I tried to remove the Ids and just kept the aaname and tag, but still the same issue

I would take everything out of the selector except the last row and see if you can get it to work that way. It should be unique element on the page without the parent(s) designated.

The selector fails to validate if I remove everything. I believe another option is to use if-else activity to select the value, though it is not an efficient approach.