Selecting first item in duplicates from a dropdown

Hi All,

I have a webpage which has a dropdown. The values in this dropdown box are not unique - there are duplicates in it. Lets say I want to spy the wording "Property – Field Review – 2018-05" from the dropdown. It occurs two times - in the 4th row and 7th row. I verified the data item value which I used in Navigate stage and it matched exactly with the drop down item value. I am assuming that the error message "No Elements Match the supplied query items" is coming because the navigate stage is unable to select the appropriate item in the duplicates.

to solve the issue, I used the position parameter and then the navigate stage was able to select the drop down item successfully. I am trying to know if there is any other way I can select the first matching element from the drop down when there are duplicates instead of using the "Item Position" value as the position might vary in different environments.
 

Attachments

  • Duplicates in Dropdown.png
    Duplicates in Dropdown.png
    21.8 KB · Views: 30
  • Navigage stage.png
    Navigage stage.png
    27.2 KB · Views: 33

VJR

Well-Known Member
Hi Highspirits,

Have you tried the Text parameter also and is it giving the same error message?
 
I could solve this issue. This is what has happened. I had to select the wording "Property - QA Review - 2018-05". I copied this word from MS word document and gave it as an input to the bot in the navigate stage. I got an error message saying the word cannot be found in the dropdown. I assumed this error might be because of the duplicates present in the dropdown but it turned out not be so. The "-" when typed in MS word document is different that when I typed in Textpad (for some reason). I figured out this by reading the dropdown (using a read stage) and then comparing the read data with the value I supplied - both are different and hence the reason for the issue.
When I typed the word "Property - QA Review - 2018-05" in textpad and then gave this as an input to the navigate stage, it worked fine. So this solved the issue of error message.
coming to the issue of duplicates, here is what I found.

1) I gave only "Item Text" in the navigate stage and the stage selected the first occurrence of the word in the drop down. So in this case, it selected "Property - QA Review - 2018-05" from File Assignments section (please see the screen shots in the first post of this thread).
2) When I gave "Item Text" and "Item Position" in the Navigate stage, I could select either first occurrence or the second one. So lets say, giving the "Item Text" as "Property - QA Review - 2018-05" and "Item Position" as 7, the second occurrence of "Property - QA Review - 2018-05" got selected from the drop down (Under "Regions" header this time).

So to conclude, if we give only "Item Text", the navigate stage would select the first occurrence of the word. If we want to select the occurrence other than the first one (from the drop down), we should use the combination of "Item Text" and "Item Value".
 
Top