Page 1 of 1

Invoke Action - Select

Posted: Tue Nov 14, 2017 3:19 pm
by armstronghm24
Hi,

In the past I recall using Invoke Action to select an item from a list in a drop down. Now when I attempt to do that, I am not getting the option "Select()" in the Action name. I only get the options Ensure Visible, Focus, get property value, and Invoke method. Am I doing something incorrectly?

Re: Invoke Action - Select

Posted: Tue Nov 14, 2017 8:38 pm
by Support Team
Hi armstronghm24,

The available list of invoke actions depends on the element itself. The invoke actions are invoking an available method built into the element. If it is missing, there is no method available on the element to invoke. For select boxes, as an alternative, you can usually use a Set Value action to select the desired value.

If you need further assistance with this, please provide a Ranorex Snapshot of this select box.

I hope this helps!

Cheers,
Ned

Re: Invoke Action - Select

Posted: Wed Nov 15, 2017 12:54 am
by krstcs
I would HIGHLY recommend NOT using Invoke action and Set unless you are absolutely sure there is no other way to do what you want.

Not only is this not what a real user would do, in many situations, due to devs not coding events sufficiently, invoke and set do not fire the expected events, so any listeners will not be notified that those actions were taken. For example, if you have a text box that is supposed to do some form of input validation, that validation may not happen if you use Set or invoke. You would need to fire events manually, which, again, is not how a real user would do it.

Unfortunately with select/option tag combo boxes in browsers, the browsers all handle them differently, so Ranorex usually has no way to know where the actual drop-down is and what elements are in it. I have found that typing the value into the select box is usually the most dependable method to have a value selected correctly.