How to verify a option has been selected from a drop down menu?

Hi all

I’m using a Select item function to choose which item I want - in this case changing the operating system to ‘Windows 7’ for example.

I’m then using a get attribute function to then return the value I have selected (‘Windows 7’) but looking at the selectors including in Ui path explorer, I can’t find which attribute which will return the value

https://www.keynotesupport.com/websites/contact-form-example-menus.shtml

Capturedropdown

Please can you help me identify the right selector/the best way of getting the selected value

Thanks
Jordan

Hi @jordrowley

Ideally, one would indeed hope for a piece of selector that can be checked for. If not, Get Text activities might still do the trick. Hopefully, these will not extract all the values and just the one that is selected.

Easy to check with the Screen Scraping wizard quickly :slight_smile:

1 Like

@loginerror, using a get text worked fine, as did using the screen scraping option and selecting the ‘native’ option. Thanks!

1 Like

hey @loginerror

Please can I ask a bonus question!

For the next menu, it requires selecting multiple items if required. I have used the 'select multiple items activity; how do I verify that these have been selected? These seems much more tricky as it could be a combination of items, like in the example below where I would need to check if Printer and Modem/Router had been selected?

image

Thanks
Jordan

This one is indeed more tricky. I would hope that the elements have something in the selector that signifies its state. You could then most likely read a list of elements with Get Text, then hopefully an array of attributes that give you the state with a looped Get Attribute, and then hopefully match these two sets of data and end up with a result.

This is a bit around, but should do the trick.

2 Likes

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