As of SilkTest 2010 R2 the DynamicInvoke functionality has been extended to include the Flex tech domain. The DynamicInvoke functionality allows the user to call any public method or property defined by the Flex API.

The following parameter types are supported:
      - All SilkTest primitive types:
            - int
            - boolean
            - string
            - lists
      - Other types such as POINTS are also supported

For example, the FlexDataGrid winclass does not provide functionality for getting the headerText property for its associated columns, the headerText property overrides the displayed text of a column. In previous SilkTest releases it would not have been possible to retrieve the text displayed on each column but using the DynamicInvoke functionality a user can have their developers provide a public method that returns the required information. The code snippet below shows an extended Flex DataGrid control:

 

The FlexDataGrid winclass defines the property columnNames, this property returns the value of the dataField attribute for a DataGrids columns. Therefore in the above example I have provided a public method getHeaderText, this method queries the columns of a DataGrid for the headerText property and stores the value of the said property for each column in an array. This array can then be returned to SilkTest as a list.

Therefore to retrieve the said displayed column text via SilkTest, our testcase could look like the following:

     [-] testcase getHeaderText() appstate none
               [ ] listprint(Desktop.Find("//FlexDataGrid[@caption='DynamicInvoke']").DynamicInvoke("getHeaderText"))