Show TOC

Function documentationTest Automation with Extended CATT

 

The extended Computer Aided Test Tool (eCATT) is used to create and execute functional tests for software. The primary aim is the automatic testing of SAP business processes. Each test generates a detailed log that documents the test process and results.

In the SAP Application Interface Framework, the test tool can be used to store predefined test data in a central repository. eCATT is used to store interface test data; The expected values and messages (success or errors) can be stored, so that the tests can be started manually or can be scheduled for regular execution.

In the SAP Application Interface Framework, the Interface Test Tool has 3 tables that enable you to set up SAP Application Interface Framework test cases for integration with eCATT.

Integration

To access eCATT, use transaction code SECATT.

You can access the Interface Test Tool from the SAP Easy Access menu by choosing Start of the navigation path Cross-Application Components Next navigation step SAP Application Interface Framework Next navigation step Interface Development Next navigation step Interface Test Tool End of the navigation path.

Prerequisites

The following are required to run tests for the SAP Application Interface Framework with eCATT:

  • ECATT System: SAP Web Application Server 6.20 or more recent

  • Target System: Web AS 4.6 or more recent

  • CATT and eCATT need to be allowed in transaction SCC4

  • RFC destinations need to be created in transaction SM59 for target systems

  • Function modules: /AIF/ECATT_TESTS_PROCESS on the target system

  • Test script /AIF/TEST_ECATT_SCRIPT_PROCESS for a description of the course of the test

Features

The testing landscape is shown in the graphic above.

In eCATT, the Test Configuration combines the information from the test script, test data, and system data for a test run and selects which test cases are used in the test run.

In Test Catalog Management, the Test Catalog is a collection of several Test Configurations that allows you to bundle test cases with different target systems.

In Test Plan Management, a Test Plan consists of at least one Test Catalog and is a prerequisite for creating Test Packages, which are in turn prerequisites for the creation of scheduled test runs. For the creation of automated, scheduled test runs, a Test Plans and at least one Test Packages are necessary. If the runs are marked as periodic, they are run periodically in the background.

Recommendation Recommendation

Starting test runs via Test Configuration is sufficient for tests whose compilation changes often and that are run occasionally. However, for tests that do not vary and are run regularly, for example, regression tests, we recommend that you create Test Plans and Test Packages. This allows you to organize tests in separate configurations, bundle them up, and run them automatically.

End of the recommendation.
The Interface Test Tool

The following test tool tables are displayed on the first Process Test Files screen:

  • Source Data Structure

    In the first table, the source data structure is displayed and you can fill the structure with data. Choose Transform to trigger the mapping of the source to the destination structure in the SAP Application Interface Framework.

  • Destination Data Structure

    This table is automatically filled after transformation. How the table is filled depends on the mapping you define for the interface. If you double click on a field of the destination structure, the value of this field and the structure path for this field is added into the Expected Values table.

  • Displays logs

    Displays the application log of the current Interface. If you select a message from the application log and choose Add to exp. messages (Add to Expected Messages), the Expected Message table is filled.

  • Expected Values table

    The Expected Values table displays the path of the structure where the value is found in the source structure, the expected value, and also a status icon. If the light is green in the Status field, the value in the Expected Messages table is same as the value in the source structure; Otherwise the status light is red.

  • Expected Messages table

    The Expected Messages table displays the corresponding message type, message ID, message number, message variables, and an Incl. Msg. Var. (Include Message Variable) checkbox. If you select the checkbox, the corresponding values of message variables in the message are considered.

On a second screen, along with information about the interface (namespace, interface name, interface version, and expected status), the expected values and test data are shown as XML string. You can copy the data displayed in Display XML Parameter for eCATT Transfer to the parameters of the eCATT test data container.

Activities

To create a test data container, copy the template /AIF/TEST_ECATT_DATA_TMPL and specify, for example, the target system and its system data container.

For entering interface test data, use the SAP Application Interface Framework Interface Test Tool (transaction code /AIF/IFTEST).

To create a new test configuration, copy the template /AIF/TEST_ECATT_CONFIG_TMPL and specify the application component, system data container, test script, target system, and test data container.

To create a new test catalog, use transaction code STWB_1.

To create a new test plan, use transaction code STWB_2.

Extended CATT

To test the functionality of interfaces, the test script requires you to enter the test data parameters, shown in the following table with both mandatory and optional entries described:

Input Parameter

Description

Mandatory or Optional

IV_NS

Interface namespace

Mandatory

IV_NAME

Interface name

Mandatory

IV_VERSION

Interface version

Mandatory

IV_XML_TEST_DATA

XML input test data as string

Mandatory

IV_XML_EXPECTED_VALUES

XML input expected values

Optional

IV_XML_EXPECTED_MESSAGES

XML input MSG log as string

Optional

IV_EXPECTED_STATUS

Expected status

Optional

IV_CHECK_FM

Function module for custom checks

Optional

To create a valid test case, you have to enter the interface’s namespace, name, and version and also a raw data structure that can be processed by the interface. You also need to enter a string containing XML data that describes the structure.

You can enter a table converted to an XML string with expected values and the path where the fields are in the source structure.

You can also enter an Expected Message table with fields such as message ID, message number, message type, and message variables if required.

Note Note

The following data can be copied from Display XML Parameter for eCATT Transfer in the Interface Test Tool (transaction code /AIF/IFTEST):

  • IV_XML_TEST_DATA

    Can be copied from Test Data as XML String

  • IV_XML_EXPECTED_VALUES

    Can be copied from Expected Values as XML String

  • IV_XML_EXPECTED_MESSAGES

    Can be copied from Expected Messages as XML String

  • IV_EXPECTED_STATUS

    Can be copied from Expected Status

End of the note.

Additionally, you can enter the name of a custom function module that overwrites the implementation logic of the standard AIF test script. To do this, it imports all of the test case’s parameters plus the destination structure. The function module returns the status of the interface processing and the tables for the failed expected messages and values.

Since the result of a test run often depends on the messages that are raised while the input data is being processed, the test script allows you to check if a certain status has been set, a certain message has been raised, or a certain field mapping has been done while processing the data. When a test run execution is complete, the results are displayed in the eCATT log. Green lines signify a successful result. Red lines indicate failure, which can mean that either an error message in the function module /AIF/ECATT_TESTS_PROCESS was raised, the checks of expected values or messages have failed, or the expected status does not fit. The failed checks are displayed in the eCATT log.

More Information

For more information on eCATT, see the SAP Library FOR eCATT: extended Computer Aided Test Tool (BC-TWB-TST-ECA) on SAP Help Portal at http://help.sap.comInformation published on SAP site.