Creating Reusable Test Data Sets

You can to a limited extent enter data values directly into test script and, as you will see later, in test configurations. However, that is not the sensible way to handle your data in most cases. With real-world testing, much of the data is identical in many different test cases. For example, currency conversion values. What is more, when these values need to be changed, you would like to be able to change them in one place and affect all the test cases. In eCATT, you achieve this by storing your data in test data containers, and then referencing the test data from within test configurations.

Test data containers consist of parameters and variants. The parameters describe the interface of the container and the variants store the data. You define the parameters in the same way that you define the parameters in a test script with the difference that there is no Visibility field – that is, defining the parameters as import or export makes no sense here.

Procedure

       1.      On the eCATT initial screen, create a test data container TUTORIAL_TDC.

       2.      On the Attributes tab, choose the General Data tab and enter the following information:

Field

Entry

Title

Test Data for eCATT Tutorial

Component

BC-TWB-TST-ECA

       3.      On the Parameters tab, create the parameters I_NAME, I_TITLE, I_DOB. Accept the default types.

       4.      We have chosen to use the same names as we used in the test script. This make it easier for us to remember how they are intended to be used. You will see later that it can make the assignment of data in test configurations easier. However, parameters need not have the same name as the parameters in the test script to which the values will be assigned.

       5.      Change to the Variants tab and create the following variants:

Variant

I_NAME

I_TITLE

I_DOB

VARIANT_1

Jones

Mr

12.10.1961

VARIANT_2

Harris

Mrs

13.10.1965

VARIANT_3

Singh

Miss

14.10.1973

       6.      Save your test data container.

Result

You have created a test data container with several sets of data.

You created the parameters manually in order to emphasize that they are independent of any test script. However, you could have created the parameters by importing them from your test script (or any other script or data container with suitable parameters). Also, if the variants had been stored in external variants, you could have imported them, rather than entering the data manually.