Parameterizing Tests - Overview

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

Recorded tests typically contain hard-coded values that make your tests “static” and difficult to modify. These tests always use the same set of testing data and always work in the same predefined manner. This prevents you from using these tests repeatedly. Also, these tests are difficult to modify, because to find and change some value used in the test, you need to look through the whole test.

The easiest way to make tests more coherent and manageable is to parameterize them, that is, to replace hard-coded input values with parameters. This allows you to re-use the test commands with multiple data sets, share test data and create more flexible test processes.

Suppose, you have a recorded test that simulates user input into the Notepad window. You can pass the text to be entered to the Notepad window as a parameter and run this test by using different parameter values. Thus, every time when you want to run a test that enters new text to Notepad, you will not have to change the test command that simulates user input, you will simply change the parameter value.

TestComplete provides several ways to parameterize tests:

  • You can use parameters in script routines and keyword tests. The parameters can store values of the following types: String, Integer, Double, Boolean and Object. See Parameterizing Script Routines and Parameterizing Keyword Tests.
  • You can specify project, project suite and network suite variables as test parameters. See Parameterizing Tests Using Variables.
  • You can parameterize your test so that the test command uses input data stored in external files. TestComplete provides advanced features for reading data from a database or any other data source like text or XML files, Excel sheets and database tables and iterating through storage records. For more information, see Parameterizing Tests Using External Data Sources.
  • You can use parameters to launch TestComplete via the command line. To determine which parameters were passed to TestComplete in its command line, use the ParamStr and ParamCount functions.

See Also

Parameterizing Script Routines
Parameterizing Keyword Tests
Parameterizing Tests Using Variables
Parameterizing Tests Using External Data Sources

Highlight search results