Page 1 of 1

InvokeAction

Posted: Sat Jan 17, 2015 11:54 am
by rawatankit6
What all actions are supported by InvokeAction(String, Object[]) and InvokeActionWithText(String, String[]) methods and when to use these methods ? And Please tell more about the .Focus() and .ensureVisible() which comes with InvokeAction and when to use them ?

Re: InvokeAction

Posted: Mon Jan 19, 2015 1:35 pm
by Support Team
Hello rawatankit6,

The Invoke action can be used for several methods depending on the type of your element. In order to check which Invoke action is available for a specific repository element, just drag&drop your element to the recording table and choose an Invoke action:
InvokeAction.png
The Invoke actions Focus() and EnsureVisible() are available for all elements (adapters).

Regards,
Robert

Re: InvokeAction

Posted: Mon Jan 19, 2015 6:55 pm
by rawatankit6
Thanks for your reply but it didn't clear my doubt, I tried using Invoke Action and InvokeActionWithText on elements of type "input", 'button", "image" mostly for click operation but it worked on some and not on others moreover the arguments these method accepts confuses me a lot.
How one can make sure what arguments these controls will support because I noticed the "PerformClick" action using InvokeAction method is not visible when one drag and drop the control to the recording pane but can be written in the string argument it support.

Re: InvokeAction

Posted: Tue Jan 20, 2015 1:52 pm
by Support Team
Hello rawatankit6,

The easiest way to find out which Invoke actions are available for a specific element is the mentioned drag&drop to the recording table.

In general, it depends on how the control or the method to invoke is implemented. We can’t provide any parameterization for custom (public) methods. These methods can be called via InvokeActionWithText(String, String[]), which allows you to specify the name of the method to be called and the parameters you want to pass to the method.

The PerformClick()-action is just available for WebElements. Further information can be found here: http://www.ranorex.com/Documentation/Ra ... mClick.htm

Regards,
Robert