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 Silk Test Workbench 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 Silk Test Workbench 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")
Silk Test Workbench types includes primitive types (such as boolean, int, string), lists, and other types (such as Point and Rect).
UI controls can be passed or returned as TestObject.
The following VB .NET script example shows how you can dynamically invoke SAP methods.
Dim _desktop As Desktop = Agent.Desktop Dim wnd As SapWindow = _desktop.SapWindow("wnd 0") Dim result As Object result = wnd.Invoke("IsVKeyAllowed", 8) ' boolean return value Console.WriteLine( "invoke result='" & result & "' type=" & result.GetType().ToString()) wnd.Invoke("ShowMessageBox", "A Title", "Some text...", 1, 1)