Organizing Data Storages

Applies to TestComplete 15.42, last modified on September 08, 2022

When creating data-driven tests it is recommended to store test data separately from test commands. This way you can include more values into testing, without modifying the 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.

Below are general recommendations on organizing storages of test data:

  • With TestComplete, you can use any data storage you need. For example:

    • A text file with comma-separated values.

    • An Excel sheet.

    • A database table.

    • A project variable of table type.

    • A script array.

    • And so on.

    That is, you can use the data storage of any nature, however, it is recommended that the storage has a tabular format, that is, consists of columns and rows.

  • You may place column names into the first row of the storage. This will make the data structure easier to understand to other testers.

    If you are using an Excel sheet, you may need to modify certain Registry key in order the test engine recognizes data of the first row as column names. See Using Excel Files as Data Storages.

  • Typically, each row in a storage contains values for one test. For instance, a row may contain values to be entered by the test into edit boxes of an application form. You can also use several strings for one test, but this can make it difficult for testers to maintain the storage and will make the iteration through the storage more complicated. So, we recommend that you use one data row per test run.

  • It is recommended that each row contains one or more verification values in addition to test data. This way it will be easier to control the test execution and it will be easier to maintain the storage for other testers.

  • A row may contain not only test data, but also data that control the testing flow. For instance, certain columns may “command” to skip entering data into some edit boxes. In this case, you must remember the purpose of each column.

  • We suggest that you place test data files in the folder where your project suite resides or in subfolders of this folder. This way it will be easier for you to copy and share your test projects: when sharing projects, you can copy the project suite folder, and the data files will be copied as well.

    Also, you can add data files to your TestComplete projects. In this case, you will be able to access them easier – to edit a file, you can simply double-click it in the Project Explorer panel. TestComplete will invoke the default editor for that file:

    Data-driven testing with TestComplete: Data files in the Project Explorer

For information on working with Excel and CSV files, see Using Excel Files as Data Storages and Using CSV Files as Data Storages.

TestComplete includes a sample data storage in the form of an Excel file:

<TestComplete Samples>\Common\Data-Driven Testing\TestBook.xlsx

Note: If you do not have the sample, download the TestComplete Samples installation package from the support.smartbear.com/testcomplete/downloads/samples page of our website and run it.

See Also

Data-Driven Testing
Data-Driven Testing - Basic Concepts
Preparing Data for Data-Driven Testing
Using Excel Files as Data Storages
Using CSV Files as Data Storages

Highlight search results