How to select value from dropdown?
-
Hello,
I need to select a certain value from a dropdown list.
I use a Get Element activity to locate the dropdown bar. I then try to record the selection of the specific value from the dropdown but it does not record it.
I also tried to use the item.Value assign to the string of the value that I need to choose but it does not work either.
This is a screenshot of the dropdown list.
I need to select "Hikvision-DVR".
I highly appreciate any advice. -
use Get Element to get the droplist
Then use item.value or item.text to select based on value or text -
@allan-zimmermann
Hey, thanks for the response.
Tried doing so but it does not work. When running the flow it just does not recognize the dropdown list.Any other ideas maybe?
-
Allan once gave me a tipp on a similarly related question. See here: https://bb.openiap.io/topic/246/openrpa-to-get-uielements-in-context-menu-and-hover-based-submenus
If everyting fails, you need to fall back to GetElement from the OpenRPA.Image group. The robot tries to find the element then based on image recognition.
-
@milner-noa without access to the site, its hard guessing what might be wrong. But try using item.text instead of value.
Also, some times a drop down is not really a dropdown <select>, but div’s and javascript. In that caee you will need to use another mechanism. -
@axel-rp Using get element image is a great workaround and worked just as I needed it to.
Thanks!
Also thanks Allan! -
@milner-noa @Allan-Zimmermann , How to select an element if I don't have that full string handy? like only "Hikevision-" not "Hikevision-DVR"?
-
@snarayanan-97 item.items will contain a list of values, you can loop that and look for the element you want.