Cogitek RIATest 3 Documentation Copyright © Cogitek Inc.

Exposing methods of custom components

Important: since RIATest 3.6 it is no longer required to manually expose the methods of custom components to make them callable from RIATest scripts. RIATest now uses reflection to automatically expose the methods. However note that features like code completion in RIATest IDE are still using the information from class information file. If you do not declare the methods in class information they will not be available for code completion.

If you have a custom component and want to be able to invoke its methods from RIATest scripts you need to expose the methods to let RIATest know about them. This is done by defining a <Methods> tag in the class information file (see Automating custom components for more details on preparing the class information file). The <Methods> tag has the following format:

<Methods> 
    <Method Name="methodName1"> 
      <Internal Type="methodName1"/> 
      <Parameter Name="someParam"> 
        <PropertyType Type="Boolean"/> 
      </Parameter> 
      <Parameter Name="anotherParam"> 
        <PropertyType Type="int"/> 
      </Parameter> 
    </Method> 
    <Method Name="methodWithoutParams"> 
      <Internal Type="methodWithoutParams"/> 
    </Method> 
</Methods> 

The tags and attributes are:

Method

Defines one method that should be exposed.

Attributes of this tag are:

Name - the name of the custom component as you want to be known to RIATest and appear in test scripts.

Internal Specifies internal method name of the custom component as it is defined by custom component.
Parameter

Describes a parameter of the method.

Attributes are:

Name - name of the property

PropertyType

Describes the type of the parameter. Attributes are:

Type - one of Boolean, Number, int, String.

Codec - optional attribute used for describing the exact type of the value. One of keyCode, keyModifier, object, object[], color, color[], automationObject, automationObject[], asset, asset[], listDataObject, listDataObject[], dateRange, dateRange[], dateObject, event, tab, scrollDetail, dateScrollDetail, scrollDirection, adgCell[].

Next: Automating custom components that contain other components.


Found a typo? Have a suggestion? Please submit your request here.