Parameterizing Keyword Tests

Applies to TestComplete 15.0, last modified on October 14, 2021

Keyword test parameters are very similar to parameters in script routines. You create them on the Parameters page of the Keyword Test editor. Here you can visually specify the parameter name, type, default value and description:

The Parameters page of the Keyword Test editor

For more information, see Keyword Test Parameters.

Keyword test parameters are accessible from any operation of the test, but they are not accessible from other tests. In the Operation Parameters wizard you can easily command a keyword test operation to use a test parameter:

Specifying an Operation Parameter's Value

A keyword test can be run as a test item or it can be executed from script code or from another keyword test. This affects how you specify the test parameters:

  • To run a keyword test as a test item, you create a new item in the Execution Plan editor of the project editor. To specify the keyword test parameters:

    • First, specify your test in the Execution Entity column.

    • Then click the ellipsis button of the Parameters cell and set the desired parameter values in the ensuing Test Parameters dialog.

    When TestComplete executes this test item it will pass the values you specified in this dialog to your keyword test.

  • To run a keyword test from another keyword test, you typically use the Run Keyword Test or Run Test operations. You specify parameters of the called test in the Operation Parameters wizard as parameters of the Run operation. The test engine passes the values you specified when the operation is executed.

  • To run a keyword test from script code, you use the Run method of the KeywordTest object that corresponds to your keyword test. In this case, the parameters of the keyword tests are specified as parameters of the Run method. When the test run is started, TestComplete checks whether the types of the specified values are compatible with the parameters’ types.

See Also

Parameterizing Tests
Parameterizing Script Routines
Keyword Test Parameters

Highlight search results