Anda di halaman 1dari 6

Organizing Test Data

PDF download from SAP Help Portal:


http://help.sap.com/saphelp_erp2004/helpdata/en/09/0a8b3f81fef93de10000000a114084/content.htm
Created on November 08, 2014

The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.

Note
This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.

2014 SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP SE. The information contained herein may be changed without prior notice. Some software products marketed by SAP SE
and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by
SAP SE and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be
liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express
warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other
SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE in Germany and other
countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Table of content

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 1 of 6

Table of content
1 Organizing Test Data
1.1 Creating Test Data Containers
1.2 Creating Variants in Test Data Containers
1.3 Importing Parameters into Test Data Containers or Test Scripts
1.4 External Test Data (External Variants)
1.5 Using External Test Data During Test Execution
1.6 Test Data Editor

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 2 of 6

!--a11y-->

1 Organizing Test Data


In eCATT, the bulk of the test data is normally stored separate from the test scripts in test data containers. The main reasons for this are reusability and
maintainability. Test data containers and a test script are brought together in test configuration to create an executable test case.
The simplest use of test data containers is to create a separate one for each test script. However, this does not provide you with many of the advantages of reuse.
A more effective way to manage test data is to create a single test data container for a whole application or sub-application (as shown in the upper part of the
graphic below). By storing all of the test data in one container, you would find it easier to keep it consistent. In contrast to using a single test data container for all
parameters, you can distribute the parameters over several test data containers (shown in the lower part of the graphic). For example, if you have a large number
of scripts, each with many parameters, you may find that using a single test data container is no longer a practical option. In this case, you could split the
parameters into logical groups, each in its own test data container.

This later approach can be illustrated by the example below, where the raw data for a transaction based on the flight data model is shown in the table. You can
see that much of the data falls into two logical groups (airline and aircraft) and many of the fields have identical values.
By separating the aircraft data and the airline data into different test data containers, you can then conveniently reuse them when a test script calls for data of the
appropriate sort. Additionally, by condensing the data so that particular combinations occur only once, (for example, LH 400) you only have to change the
combination in on place, to affect all tests that reference it.

The Parts of a Test Data Container


As with other eCATT objects, the test data container has mandatory attributes (title, package, person responsible, and application component) as well as
attributes containing administrative information. 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. If a parameter is structured, you can display and edit in the structure editor.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 3 of 6

Each variant contains a field for each parameter. If no value has been entered in a field, the value specified in the ECATTDEFAULT is the value of the field.

!--a11y-->

1.1 Creating Test Data Containers


Procedure
1. On the Extended Computer Aided Test Tool: Initial Screen screen, select Test Data and enter a name for the test data container.
2. Choose
.
The test data editor appears.
3. Choose the Attributes tab and maintain the attributes. The required fields are Title and Component.
4. Choose the Parameters tab.
5. Choose
to append a parameter. Do this as many times as required.
6. Enter the required information.
A parameter need not have the same name as the parameter of the test script with which it is to be used. However, some of the options in the test
configuration (for example, Attach as variant ) do depend on the name being the same. The type need not be the same as in the test script but will get
problems if you use incompatible types.
7. Choose the Variants tab and maintain the variants. See Creating Variants in Test Data Containers.
8. Choose

!--a11y-->

1.2 Creating Variants in Test Data Containers


Use
You can specify variants, which are sets of different parameter values. ECATTDEFAULT is the default variant. Its values are those that were entered on the
Parameters tab. If a variant has a parameter that has no value assigned to it, the corresponding value from ECATTDEFAULT will be used.

Prerequisites
At least one parameter has been defined on the Parameters tab.

Procedure
In the test data editor, choose the Variants tab.
Choose
to append a new variant.
In the Variant field, enter a name for the variant.
For each of the parameters, either enter a value or leave the field empty.
Choose

!--a11y-->

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 4 of 6

Importing Parameters into Test Data Containers or Test Scripts


Use
If parameters are already defined in other eCATT objects (test scripts and test data containers), you can copy them into a test data container. The copied
parameters are exactly the same as if you had manually entered them, complete with values. See also, External Test Data (External Variants).
Similarly, you can copy parameters into test scripts. Test scripts also have the possibility of importing command interfaces. The command interfaces are
complete with values and parameter names. See also, Refreshing Command Interfaces.

Procedure
1. Open the eCATT object for editing.
2. Choose Edit Import Parameters .
The Import Parameters dialog box appears.
3. Select the type and name of the eCATT object containing the parameters to be imported. You can also specify a version of a test script.
4. Choose Get Parameters .
The parameters are displayed in the left pane. For test scripts, you can toggle between the display of parameters and command interfaces.
5. Select the parameters that you want to copy.
6. Choose Append . Alternatively, use drag and drop.
The selected parameters are displayed in the right pane.
7. Choose Copy .

!--a11y-->

External Test Data (External Variants)


Use
External variants allow you to use test data stored in external files. They are applicable to both test data containers and test configurations.
You can create variants of parameter values in the relevant editors in eCATT. However, if the data is in the appropriate format, you can also upload variants
containing test data into a test data container or test configuration from your front-end workstation or its network drives. This is particularly useful if you have a large
quantity of existing data. Using the download function provides the files on your front-end workstation in the correct format.
When you upload external variants, you can decide whether all existing variants in the test data container or test configuration (with the exception of
ECATTDEFAULT) will be deleted or not. Test data for parameters and variants existing in both test data container and the external file will be overwritten in the test
data container during upload.
Instead of permanently overwriting variants in a test configuration, you can select to upload the external variants at runtime. For more information see Using
External Test Data During Test Execution.

File Formats
There are two formats TXT and XML. Each has advantages and disadvantages.
TXT
The TXT format is simple and is similar to CATT external variants. It is easy to fill TXT files with data programmatically, or to edit them in a text editor or
spreadsheet. Because Excel is often used to edit this type of file, numbers are prefixed with # to prevent Excel from formatting them differently. If you use a normal
text editor, you can omit the # but you should be aware that files downloaded from eCATT will contain the # character.
An asterisk (*) denotes a comment line. This must be in the first position on the line (in a spreadsheet, the first position of the first cell).
The TXT format cannot be used for structured parameters.
XML
The XML format allows the use of structured parameters in external variants. When you download a file from eCATT, you will also get the appropriate schema in
the form of an XSD file.

Default Path
You can set the default path for upload and download. To do this, choose Utilities Settings and then the eCATT and Editor tabs. Then enter the path on in
the Variants field.

Prerequisites
The parameters must already exist in the test data container or test configuration to which you want to upload the data.

Procedure
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 5 of 6

Downloading Variants
1. In the test data editor or test configuration editor, choose Edit Variants Download .
The Save as dialog box appears.
2. In the File name field, enter a name for the file.
3. In the Save as type field, select either TXT or XML. Structured parameters can only be saved in XML.
4. In the Save in field, browse to the folder where the file is to be saved.
5. Choose Save .
In a test configuration, a dialog box gives you the option to replace references to test data containers with the fixed values.

Uploading Variants
1. In the test data editor or test configuration editor, choose Edit Variants Upload.
2. In the dialog box, browse to the folder where the file is stored and select the file.
3. Choose Open .
4. Specify whether the existing variants should be deleted before the external variants are uploaded.

!--a11y-->

Using External Test Data During Test Execution


Use
You can upload external test data from a file on your front-end workstation directly before a test script is executed as part of the execution process. You can
specify the location of the file in the test configuration and in the start options. Specifying a location in the start options overrides the settings from the test
configuration.
If you specify that external variants are to be executed (by selecting External Variants ), all the variants defined in the external file are executed and none of the
internal variants defined in a test configuration are executed.

External Test Data in Internal Variants


When you reference a test data container from an internal variant of a test configuration, the setting in the test data container determines whether the data is read
from the test data container itself or from the external file specified in the test data container.

!--a11y-->

1.6 Test Data Editor


Use
You use the test data editor to create and maintain test data containers.
The parameters in a test data container are maintained independently from any test script. You can specify a maintenance system for the test data container, and
can also specify a different target system for each parameter.

Downloading Test Data Containers


You can download a test data container as an XML file.

Variants
You can create variants containing different parameter values. There is always a default variant called ECATTDEFAULT. This contains parameter values that are
used if a corresponding value has not been entered in a variant.
Default values in the test data container override the default values of the test script if they are referenced by the test configuration. That is, when a field referenced
from a test configuration contains no value, the default value from the test data container is checked, and when that has no value, the default value in the test script
is used.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 6 of 6

Anda mungkin juga menyukai