Data-Driven Testing With Keyword Tests - Tutorial

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

About

The main idea of data-driven testing is to separate test commands from the data that is used for testing and run tests with different sets of input values. This tutorial demonstrates how to perform data-driven testing with TestComplete keyword tests.

Sample Application

In our explanations we will use the Orders sample application that is shipped with TestComplete. You can find this application in the following folder:

<TestComplete Samples>\Desktop\Orders\C#\bin\Release\Orders.exe

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.

The New Order dialog

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 object names in the test commands.

Requirements

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 Steps

In the Tutorial

Start

See Also

Data-Driven Testing

Highlight search results