File Test Case Loader for SAP PI/PO

This feature is dedicated to the non-SAP middleware migration to SAP PI/PO.

 

Overview

Int4 IFTT Test Case Loader is a functionality thanks to which we can upload test cases into IFTT. This tool supports uploading a single test case (consisting of a pair of input and output payloads). It can also be used to mass upload from a folder using a regular expression to match the input/output files.

Each test case added using IFTT TC Loader will be uploaded in PI Unit Test mode (interface type 20) with an input and an output payload. The uploaded test cases can then be executed to validate the processing in PI (routing, mapping, or modules). For supporting the execution of the test case on the PI system, payloads will be wrapped with a SOAP XI3.0 envelope before being stored in the IFTT's database. The Loader functionality can be used to, e.g., upload payloads extracted from other middleware into IFTT since it can cater for uploading of XML and flat files.

IFTT Test Case Loader layout

The IFTT Test Case Loader consists of two screens:

  • main screen, where you can fill in all the parameters before uploading files and creating the test case,

  • results screen that displays the summary after executing the Test Case Loader.

Main screen

Test Case Loader main screen consists of several selection screens:

Test Case Loader Screen

And each section (A - File Selection, B - IFTT Test Case Details, C - Interface Details, and D - Message Content Type) consists of the following elements (marked in the screenshot above):

A. File Selection

1 & 2

Radio Buttons for selecting single or multiple test case upload mode

3

Input and output file for single test case

4

Folder for multiple test cases

5

A regular expression for matching pairs of input and output files. Two capturing groups are required in the expression:

  1. The first group for common identifier in both input and output files

  2. The second group for the identifier of file type (in or out)

B. IFTT Test Case Details

1

IFTT Scenario ID (folder) to upload the test case(s) to

2

IFTT Automation Object for the test case(s)

C. Interface Details

1

Details of the sender for the XI 3.0 envelope. Mandatory fields are Service, Interface & Namespace.

2

Details of the receiver for the XI 3.0 envelope. Mandatory fields are Service, Interface & Namespace

D. Message Content Type

1

Radio Button for selecting the content type of input message. This setting affects the Content-Type MIME header in the XI 3.0 envelope, ensuring the message triggered from IFTT to PI can be viewed correctly in Message Monitor (XML, Flat File is the default and only option)

2

Radio Button for selecting the content type of output message (XML, Flat File is the default and only option)

Result screen

Upon completion of processing, the IFTT Loader results are displayed in an ALV, as shown below.

The result screen consists of the following elements

1

An icon indicating the processing status of an individual file

2

Unique identifier of test case pair

3

The file path of the processed file

4

IFTT Test Case ID created using Loader

5

IFTT payload type added to test case:

  • M – Request (input)

  • R – Response (output)

6

Content counter for responses

7

Error message (if any) during the processing of file

IFTT Test Case Loader use

Tcode for Int4 IFTT Test Case Loader is /INT4/IFTT_PO_LOADER.

The report is also available from the GOTO menu of the main Int4 IFTT cockpit.

As already mentioned, there are two modes of uploading test cases into IFTT using Test Case Loader:

Below you can find manuals on how to use each mode.

Single test case upload

  1. Let's assume that we want to test an interface for which both input and output are XML messages. To be able to load them into IFTT, the messages should be saved in separate files, i.e.:

a. Input file (filename: test_case_loader_input.xml):

b. Output file (filename: test_case_loader_output.xml):

2. The files prepared in the first step should be selected in section A (File Selection):

3. Next, in section B (IFTT Test Case Details), select folder from IFTT Cockpit in which the test case should be saved and Automation Object for the test case:

4. Later in section C (Interface Details), fill out the details about the tested interface as follows:

5. In section D (Message Content Type), the type for input message and the output message is set by default as XML, Flat File. In the next step, click the "Execute" button in the top menu:

6. Upon completion of processing, the results will be displayed in an ALV, as shown in the example below.

7. As we can see in the previous step, the test case was saved with ID 20008. To verify it, we can go to the IFTT Cockpit (using tcode /int4/iftt_cockpit) and find the created test case:

And finally, execute the test case created using the IFTT Test Case Loader:


Multiple test cases upload

The procedure for multiple test cases uploading mode is the same as for a single test case. In this case, the only difference is that we should prepare the files with input and output messages so that regular expression (defined in field 5 of section A (File Selection)) would be able to match input and output messages for each test case.

The default RegEx used in the Test Case Loader is as follows:

(\w+)_(in|out)_\w+

Which determines that the filename should be defined according to the following scheme:

  • Input file name: testcaseidentifier_in_anytext (for example: tc1_in_interface1)

  • Output file name: testcaseidentifier_out_anytext (for example: tc1_out_interface1)

Please note that you can use any custom regular expression. However, consequently, the filenames must also be defined according to this expression. Then the TC Loader based on RegEx will be able to identify the message direction (filename containing "in" or "out") and also a unique test case identifier.

Below you can find steps for an example of using IFTT Test Case Loader to create multiple test cases from a folder with files:

1. First, we need to prepare a folder with files - in this example, we will create 10 test cases by uploading the following files in a folder named “Multiple_Test_Cases_Upload”:

As we can see, we will upload 20 files in total because for each test case, we will upload two files (input and output separately).

2. After proper preparing of files and placing them all in one folder, we select this folder in IFTT Test Case Loader in section A (File Selection):

Other settings (in sections B - IFTT Test Case Details, C - Interface Details, and D - Message Content Type) are the same as in the example for single test case upload, because we are testing the same interface.

3. Next, click the "Execute" button, and you will get ALV with results:

4. As we can see, all test cases have been correctly created, so we can go to the folder in the IFTT Cockpit where they were saved and execute them:

Final execution report for 10 test cases created using Int4 IFTT Test Case Loader mass upload mode:

 

© 2017 - 2022 Int4 AG All rights reserved