Preparing Data for Data-Driven Testing

Applies to TestComplete 14.70, last modified on April 22, 2021

When creating data-driven tests, you need to have some data to use it in your tests. We recommend that you store this data in external files or data storages. In this way you can include more values in your tests without modifying test commands. For instance, if you store values in a file, you may simply append more rows to the file without modifying your keyword test or script.

For data-driven tests in TestComplete, you can use the following types of data storages:

To prepare such test data storages, we recommend that you use one of the following approaches:

  • Generate test data using the TestComplete “Data Generation” feature. You can create an Excel file or a TestComplete Table variable that will store generated data. For this purpose, you just need to open the Data Generator wizard and specify all the desired parameters in it. After that, you can use the generated data in your tests. For example, using this wizard you can create an Excel file with the desired number of columns and you can also specify a data type for each generated column. You can also specify some limits for the values that will be stored to the file. For more information, see the description of the Data Generator wizard.
  • Create a Table variable. You can create a TestComplete Table variable, store test data to it and then use the stored data in your tests. However, in this case, you will have to specify the data stored to a variable manually. To create such a variable and specify data to be stored, you can use the Add Variable, Add Variable to Keyword Test or Data Generator wizard.
  • Create an external file manually and populate it with the desired test data. To obtain the file's content from your test, you can use the DDTDriver program object and its methods.

For recommendations on organizing test data files, see Organizing Data Storages.

See Also

Data-Driven Testing
Data Generator Wizard
Data-Driven Testing - Basic Concepts
Organizing Data Storages
Using CSV Files as Data Storages
Using Database Table as Data Storages
Using Excel Files as Data Storages

Highlight search results