In part I of my eCATT series of blogs, I covered the introduction to eCATTs, prerequisites, basic features, and the four main eCATT’s objects.

In this post I will explain in greater detail the test script editor and I will provide detail on how to record a test script using the SAP GUI mode.

Test Script Editor

The test script editor is used to create and maintain test scripts. You can use the recording functions, or directly input eCATT commands into the command editor to create test scripts.  The test script editor contains the following areas:

    • Application Toolbar
    • Information Toolbar
    • Editor tab
      • Parameter List
      • Command Editor
      • Structure Editor
    • Attribute tab

I will briefly explain the most important areas in the test script editor, I do however recommend going through the various menu options and areas to familiarize yourself with the editor.

Parameter List

The parameter list contains the parameters and the command interfaces. We can toggle between the display of parameters and command interfaces by choosing .

Values of simple parameters are displayed and edited in the parameter list. This is different to the structure editor.  When defining structured parameters in the parameter list, you can assign ABAP Dictionary references in the Parameter Reference field.

We can display the values of a selected command interface or structured parameter by choosing . In the parameter list we also define the visibility of the parameters. This determines whether a parameter is treated as an export parameter (E), an import parameter (I), or a local variable (V).

Command Editor

The command editor is a basic text editor. It allows us to enter eCATT commands in a number of ways:

  1. Using “Pattern” in the application toolbar
  2. Typing the command directly
  3. Copy and paste

It also worth noting that we  can also use any standard ABAP commands enclosed inside an ABAP…ENDABAP block within the command editor.

Structure Editor

Remember a structure can be a command interface or a structured parameter. You will notice however, that when you first open the script editor, the structure editor is not visible. To display the structure editor , double-click a structure or command interface in the parameter list or command editor.

The values of a structure are shown in the right-hand side of the structure editor. To display fields of a structure for editing, double-click the corresponding elements in the tree. The selected elements are displayed in the right-hand side of the structure editor where their values may be changed.  Values can be initial , fixed , or parameterized .

Recording a Test Script

The scenario I am going use to create our example test script is simply to change the gross weight for a material. It is advisable to run through the steps you wish to record before beginning to record the scenario.

The steps in our simple example to change the gross weight of a material will be:

  1. Enter Transaction MM02.
  2. Enter a Material Number.
  3. Select “Basic Data 1” from the “Select View” popup.
  4. Overwrite the value for “Gross Weight” on the “Basic Data 1”
  5. Hit Save to commit changes.

Create the test Script

    1. Execute the ECATT transaction (SECATT) and enter name for the script for my example I choose “ZMATERIALWEIGHT_CHANGE”. Then  hit the create object button.

    1. In the Attributes -> General Tab, populate the following:
      Title = Test Script to update gross weight on material master.
      Component = LO-MD-MM.
      System Data Container = Leave Blank (As we are running the script in the same system it will be recorded in).
      Target System = Leave Blank (As we are running the script in the same system it will be recorded in).

    1. Click save and save as a local object.
    2. Click on the editor Tab
    3. Click the pattern button in the information toolbar and select the following per the image:

    4. In the Record SAP GUI Command screen, Enter the following and then hit “Start Recording”
      • Manual Generation = ‘checked’
      • Start Recording with Transaction = ‘MM02’
      • Reset GUI = ‘X’ in first created SAPGUI Command = ‘checked’
    5. Click “OK” on Script attach Popup.

    1. Click “YES” on Record SAP GUI Window.

    1. We should get a new screen whereby we follow the steps outlined earlier in our process to change the gross weight of a material.
    2. When you have saved the change to the material master you should see a screen like the one below. Simply click “Stop Recording” and you should be returned to your test editor.

    1. Your command editor should now contain a line similar to SAPGUI ( SAPGUI_1 ).

  1. Finally click save to save our script that now contains the recording of MM02.

Our script to change the gross weight of a material is now recorded as we can see in the screenshot of the test script editor. In my next post I will walk through how we can use this script in a test configuration  to paramterize the material and weight fields so we can re-run this script to change the weight on other materials. I will also introduce the concept of a variant which will allow us to execute this script for multiple material in one fell swoop.

Pin It on Pinterest

Shares
Share This

Share This

Share this post with your friends!