Dynamic invoke enables you to directly call methods, retrieve properties, or set properties, on an actual instance of a control in the application under test. You can also call methods and properties that are not available in the Silk4J API for this control. Dynamic invoke is especially useful when you are working with custom controls, where the required functionality for interacting with the control is not exposed through the Silk4J API.
Call dynamic methods on objects with the invoke method. To retrieve a list of supported dynamic methods for a control, use the getDynamicMethodList method.
Call multiple dynamic methods on objects with the invokeMethods 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.
control.invoke("SetTitle","my new title");
Silk4J types include primitive types, for example boolean, int, and string, lists, and other types, for example Point and Rect.
Enum parameters must be passed as string. The string must match the name of an enum value. For example, if the method expects a parameter of the .NET enum type System.Windows.Visiblity you can use the string values of Visible, Hidden, or Collapsed.
Pass .NET struct and object parameters as a list. The elements in the list must match one constructor for the .NET object in the test application. For example, if the method expects a parameter of the .NET type System.Windows.Vector, you can pass a list with two integers. This works because the System.Windows.Vector type has a constructor with two integer arguments.
Control parameters can be passed as TestObject.
To retrieve this string representation, call the ToString method on returned .NET objects in the application under test.
tabItem.invoke("SelectionItemPattern.Select"); mySilverligtObject.getProperty("IsPassword");