__callmethod__ Method

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

In Python code, you can use __callmethod__ to call an object’s method given the method name as a string.

__callmethod__ works similar to aqObject.CallMethod, but is easier to use in Python.

Declaration

Obj.__callmethod__(MethodName, Param1, Param2, ..., ParamN)

Obj Any object that supports the IDispatch interface
MethodName [in]    Required    String    
Param1 [in]    Optional    Variant    
Param2 [in]    Optional    Variant    
...
ParamN [in]    Optional    Variant    
Result Variant

Applies To

IDispatch objects, for example, TestComplete scripting objects (Sys, Log), test objects obtained from applications (Aliases.browser), COM objects, and others.

Parameters

MethodName

A string containing the name of the method to be called.

Param1, Param2, ..., ParamN

If the called method has parameters, specify the parameter values.

Result Value

The return value of the called method, or None if the method did not return anything.

Example

Python

Log.__callmethod__("Message", "test")

See Also

__getprop__ Method
__setprop__ Method
Python - Specifics of Usage

Highlight search results