Run Method

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Use the Run method to execute the keyword test, to which KeywordTestObj corresponds, from script code. The method does not return the control until the execution of the keyword test is over.

Declaration

KeywordTestObj.Run(Param1, Param2, ...)

KeywordTestObj An expression, variable or parameter that specifies a reference to a KeywordTest object
Param1 [in]    Optional    Variant    
Param2 [in]    Optional    Variant    
...
Result Variant

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

Param1, Param2, ..., ParamN

Specifies the values of keyword test parameters. These parameters can be created and modified on the Parameters page of the Keyword Test editor. The order of parameters in the method call must coincide with the order of parameters on this page.

Result Value

The method returns the same value that the called keyword test returns. This value can be of any Variant-compatible type: integer, string, boolean, object reference and so on. For more information on returning values from keyword tests, see Getting Keyword Test Result.

Remarks

For more information on running keyword tests from scripts, see Running Keyword Tests.

For information on how to output data from test, see Getting Keyword Test Result.

Example

The code below demonstrates how you can run a keyword test from your script.

JavaScript, JScript

var KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run();

Python

KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()

VBScript

Set KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()

DelphiScript

var
  KeywordTestObj : OleVariant;
begin
  KeywordTestObj := KeywordTests.Keyword_Driven_Test_Name.Run;
end;

C++Script, C#Script

var KeywordTestObj = KeywordTests["Keyword_Driven_Test_Name"]["Run"]();

See Also

Running Keyword Tests
Setting and Checking a Keyword Test Result
Keyword Tests
Keyword Tests

Highlight search results