Select Items from Dropdown

I have a drop down on a web-page from where I have to select a text based on what the data from the excel file says.
I am trying to do the following -
The input data from excel file has multiple columns but I have to use 2 columns and based on that select a text from the drop down on the web page.
The first column has value “Shipping abc” and second column has “9 hr”, the drop down that I have to select based on these 2 column values is “abc - block of - 9 hours($135)”.
How can I do this search on the dropdown and select it? Any insight would be great.

1 Like

Hey @Sunny_Jha

Is your text block of & 135$ is that constant ?

Thanks
#nK

Hi @Sunny_Jha have you tried wildcarding the parts of text that do not match the data in excel? If using the select activity I’m not sure off the top of my head if it allows you to wildcard in properties, but if clicking the drop down and clicking the option (like a human would) you should be able to manipulate the selector to get rid of the clutter in the string.

1 Like

block of is constant but the amount in the brackets can change. Also the format is always “x - block of - x hours($x)”
x → being variable

1 Like

Can you tell me which attribute to use for wildcard? I am seeing the innertext attribute but that holds all the 30 different drop down values. I can’t seem to find any unique attribute that I can use to manipulate the selector.

1 Like

I’m sure there’s a way with the select activity, but me being me I would stop using select and just use the basic click activities. That way I can wildcard it and move on. Please let me know if you find a way to wildcard using Select :slight_smile:

1 Like

Hey @Sunny_Jha @k.entwistle

Kindly note, You can use wildcards in the Select Item value

Thanks
#nK

2 Likes

Hey @Sunny_Jha

You can use the below as value for your select item,

row(0).ToString.Trim.Split(" "c).Last().Trim + "*" + row(1).ToString.Trim.Split(" "c).First().Trim + "*"

Hope this helps

Thanks
#nK

Thanks Nithin, I’ll give this a try.

1 Like

@k.entwistle and @Nithinkrishna thanks to both of you I got an idea from both of you. So I created a string variable called str_dropdownSelect and stored the value “x - block of - x hours” inside it. I then used click activity to click on the drop down and then used type into activity to send str_dropdownSelect+“[k(enter)]” in it to finalize the selection. That worked!

1 Like

Cool @Sunny_Jha :slight_smile: :+1:

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