Run Method

Applies to TestComplete 15.65, last modified on July 17, 2024


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.


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:


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.


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.


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

JavaScript, JScript

var KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run();


KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()


Set KeywordTestObj = KeywordTests.Keyword_Driven_Test_Name.Run()


  KeywordTestObj : OleVariant;
  KeywordTestObj := KeywordTests.Keyword_Driven_Test_Name.Run;

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