$call Method

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

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

$call works similar to aqObject.CallMethod, but is easier to use in JavaScript.

Declaration

Obj.$call(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 undefined if the method did not return anything.

Example

JavaScript

Log.$call("Message", "test");

See Also

$get Method
$set Method
JavaScript - Specifics of Usage

Highlight search results