How to use InvokeRemotely on Element : Automation API

How to use InvokeRemotely on Element

Class library usage, coding and language questions.

How to use InvokeRemotely on Element

Postby Marianne Jacobsen » Mon Nov 30, 2009 3:32 pm

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
Marianne Jacobsen
 
Posts: 44
Joined: Fri Oct 26, 2007 2:18 pm

Re: How to use InvokeRemotely on Element

Postby Support Team » Mon Nov 30, 2009 5:44 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests