Dynamically Invoking Apache Flex Methods

You can call methods, retrieve properties, and set properties on controls that Silk Test Classic does not expose by using the dynamic invoke feature. This feature is useful for working with custom controls and for working with controls that Silk Test Classic supports without customization.

Call dynamic methods on objects with the DynamicInvoke method. To retrieve a list of supported dynamic methods for a control, use the GetDynamicMethodList() method.

Retrieve dynamic properties with the GetProperty method and set dynamic properties with the SetProperty() method. To retrieve a list of supported dynamic properties for a control, use the GetPropertyList() method.

Note: Most properties are read-only and cannot be set.

Supported Methods and Properties

The following methods and properties can be called:

  • Methods and properties that Silk Test Classic supports for the control.
  • All public methods that the Flex API defines.
  • If the control is a custom control that is derived from a standard control, all methods and properties from the standard control can be called.

Supported Parameter Types

The following parameter types are supported:

All built-in Silk Test Classic types
Silk Test Classic types includes primitive types, such as boolean, int, and string, lists, and other types, such as Point.

Returned Values

The following values are returned for properties and methods that have a return value:

  • The correct value for all built-in Silk Test Classic types. These types are listed in the Supported Parameter Types section.
  • All methods that have no return value return NULL.

Example

A custom calculator control has a Reset method and an Add method, which performs an addition of two numbers. You can use the following code to call the methods directly from your tests:
customControl.Invoke("Reset")
REAL sum = customControl.DynamicInvoke("Add",{1,2})