TestComplete samples (both built-in and additional) are located in the <Users>\Public\Public Documents\TestComplete 15 Samples folder.
Some file managers display the Public Documents folder as Documents.
The main idea of data-driven testing is to separate test scripts and instructions from the data that is used for testing. Normally, a test data storage is a table whose strings hold data of a certain test. Excel sheets, database tables, text files and arrays can be used as data sources.
This tutorial demonstrates how to perform data-driven testing with TestComplete. For this purpose we will use the Orders sample application that is shipped with TestComplete. You can find this application in the following folder:
The application displays a list of orders and lets users create, modify and delete orders.
To create a new order in the application, you select Orders > New Order from the application’s main menu. This invokes the Order form that contains the edit boxes, in which a user can input values, and edit boxes, whose values are calculated automatically. The purpose of our test is to read data from the data storage, simulate data input into the form’s edit boxes and check whether the application calculates values for the Price Per Unit, Discount and Total edit boxes correctly.
|Note:||In our explanations we will use a C# version of the Orders application. If you decide to choose an application written in another language, you will have to change the script statements that are used to address the form’s controls.|
The test will read data from an Excel sheet. In order for TestComplete to be able to read data from an Excel file, you must have Microsoft Office 12.0 Access Database Engine OLE DB Provider. If you have the 32- or 64-bit version of Microsoft Office 2010 or later on your computer, then, most likely, you have the provider on your computer. If not, you will have to install it. The provider is part of Microsoft Access Database Engine 2010 Redistributable. You can download its installation package from the Microsoft website:
Microsoft Access Database Engine 2010 Redistributable x64
Make sure to download the installation package that matches the bitness of your TestComplete version. If you use the 32-bit driver from the 64-bit version of TestComplete, you will get the “The needed data source driver is not installed...” error message.
|If you have 32-bit Microsoft Office 2010, the installation of the 64-bit provider will fail. In this case, perform the following steps to install it:
Show StepsHide Steps
In the Tutorial
The tutorial includes the following steps: