Set Value not working for combo box

Best practices, code snippets for common functionality, examples, and guidelines.
armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Set Value not working for combo box

Post by armstronghm24 » Mon Mar 05, 2018 5:34 pm

I have used the set value action many times before to select a certain value from a dropdown. It is not working for a specific drop down now for some reason. The status after I run the step is successful, but no value was actually selected.

I have attached a snapshot
Attachments
CBOnewDBO2.rxsnp
(32.51 KiB) Downloaded 16 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3915
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Set Value not working for combo box

Post by odklizec » Tue Mar 06, 2018 8:25 am

Hi,

There seems to be nothing inside the combo you posted? It looks like disabled combo, which means there is probably nothing to set? Are you sure it's editable? Could you please take a snapshot of expanded combo?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Re: Set Value not working for combo box

Post by armstronghm24 » Mon Mar 12, 2018 8:18 pm

I am not sure how to take a snapshot of the expanded combo box. I did make a selection manually and captured a snapshot of that.
Attachments
CBOnewDBO3.rxsnp
(33.66 KiB) Downloaded 12 times

qwertzu
Posts: 178
Joined: Wed Jan 25, 2017 11:08 am

Re: Set Value not working for combo box

Post by qwertzu » Thu Mar 15, 2018 1:02 pm

hi,
after clicking "Track" in Ranorex Spy, please hold F12 to pause the tracking and click to expand the conbobox. Then, release F12 key and track one of the elements of the combobox.
Please share the snapshot afterwards.

If you can't identify elements of the combobox, you could activate GDI, by adding the class name to the GDI capture list.
add_to_gdi.png
add_to_gdi.png (19.24 KiB) Viewed 517 times
afterwards, refresh the spy and see if text elements can be identified.
regards, qwertzu

armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Re: Set Value not working for combo box

Post by armstronghm24 » Tue Apr 17, 2018 4:39 pm

Attached is a snapshot of one of the elements in the dropdown.
Attachments
CBOnewDBO4.rxsnp
(1.86 KiB) Downloaded 10 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3915
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Set Value not working for combo box

Post by odklizec » Wed Apr 18, 2018 9:27 am

Thanks for the snapshot. So what exactly happens, if you use SetValue action? And to which attribute you have the SetValue attached to?

If SetValue does not work with ControlText or Text (for given ComboBox), then you must use mouse click to expand the combo and second click to select the item in expanded combo. In other words SetValue is most probably no solution for you. Anyway, using mouse clicks is much more proper way of setting value in combo. SetValue is just a "shortcut" and not exactly user-like approach, so it should be used with caution.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration