Page 1 of 1

How to use InvokeRemotely on Element

Posted: Mon Nov 30, 2009 2:32 pm
by Marianne Jacobsen
Do I need to use Elment.As<Control>() before I can use invokeremotely? I can see the GetPropertyValue, SetPropertyValue and InvokeRemotely on my element (in the Actions list) - so is a cast necessary?

Thanks

Re: How to use InvokeRemotely on Element

Posted: Mon Nov 30, 2009 4:44 pm
by Support Team
A cast is not necessary, if you invoke the actions using the Element.InvokeAction method. However, if you cast the element to a Ranorex.Control, you have typed methods for the corresponding actions, e.g. an InvokeRemotely method with all the arguments that are needed and the right type of arguments.

So, if you use the Ranorex.Control class, the code completion and the compiler will help you and check that you are using the right type of arguments. If you don't cast to Control, but use the Element.InvokeAction method instead, you need to make sure yourself that you use the right action name and the right arguments. Additionally, the cast will check if the element supports the Control capability and the actions related to that capability (e.g. InvokeRemotely).

Regards,
Alex
Ranorex Support Team