Show TOC

Procedure documentationEditing a Test Script

 

When you have recorded a test script, you can edit and complete it:

  • You can edit components of a test script that was recorded with the Component-Based Test Automation (CBTA) tool in the Test Repository view of the Test Management work center.

    A CBTA test script consists of two types of components:

    • Default components are delivered by SAP with the CBTA software. They are stored in the SAP Solution Manager repository for eCATT test scripts. They perform single standard actions, for example, entering a value in a field, pressing a button, or selecting a tab page.

    • Screen components are generated after the recording of a test, depending on the screens that were used in the recorded process step. The inspection process retrieves static information on the screen from the system under test. It generates a screen component for each screen, which is a logical part of a page. A screen component contains one parameter for each field of the screen. When a value is assigned to such a parameter, the system enters it in the corresponding field, at execution time.

      A screen component reflects a single version of a screen. Different versions of a screen, for different tests, are stored in different logical components for different logical component groups. So test management can differentiate between different versions of the same screen. The version of a screen is the same on all systems of the same logical component. Otherwise, screen components are created.

    You can reuse default and screen components in several test scripts. When a screen is updated, its screen components can be repaired, to make the repair of test scripts easier. This process uses the technical bill of material (TBOM) and Business Process Change Analysis (BPCA), to reduce the effort of testing after a system update or upgrade. For more information, see TBOM Worklist and Business Process Change Analyzer.

  • You can also edit steps (modules) from an eCATT test script or from a eCATT test script combined with third-party test tool steps. For more information, see Combining Test Script Steps from Different Tools inCreating a Test Script.

  • Restrictions:

    • If a test script was modified in eCATT, you can no longer edit it in the Test Repository view of the Test Management work center. To edit the test case, open the test configuration and choose Start eCATT.

    • If you use a third-party test tool, the Test Script tab page is not displayed in the editor for test configurations. The content of the test script can only be interpreted by the third-party tool, not by SAP Solution Manager.

Prerequisites

You have created a test configuration including a test script and maintained the test configuration attributes as described in Defining Test Configuration Attributes and Creating a Test Script.

Procedure

  1. In the Test Repository of the Test Management work center, select the test configuration that includes the test script you want to edit.

  2. Choose the Test Script tab.

    The test script steps are displayed. In a CBTA test script, steps are either default or screen components. In an eCATT or composite test script, the steps can be test scripts of any test tool type.

    If you use CBTA, you have the following options:

    • In the Comment column, you can enter or edit a description of the test script step.

    • In the State column, you can disable a test script step temporarily. During test executions, the step is skipped, so you can, for example, try various variants of a test script without having to remove steps.

  3. You can add test script steps, under Test Script Steps:

    • For a CBTA test script:

      1. In the Type column, select a component type:

        • Use Default Component to perform basic actions, such as entering a value in a field, selecting a tab page, pressing a button, or clicking on a link.

        • Use Screen Component to set the values of a set of fields in one screen (SAP GUI) or views (CRM Web Client or Web Dynpro ABAP).

          To identify the screen or views of a field, do the following in the CBTA tool, choose the Get Additional Information button. Then, select the session showing the field and select the field with your mouse pointer. The technical information is displayed: the URI that identifies the field, and the screen (program and screen number for SAP GUI) or the application and view (CRM Web Client and Web Dynpro ABAP).

          To use this information to create a screen component, choose CBTA Inspection.

      2. In the Name column, select the test script.

    • For an eCATT or composite test script:

      1. In the Type column, select the type of the test tool with which the test script was created.

      2. In the Name column, select the test script.

      3. In the Version column, enter the relevant version, which is 1, in most cases.

    Save your entries. Empty lines are removed automatically.

  4. To define the sequence of test script steps, use the Up and Down buttons.

    To remove a superfluous step (for example, because you have performed it twice, by mistake) choose Remove.

  5. Configure parameters under Start of the navigation path Test Script Next navigation step Parameters End of the navigation path:

    • To define the values passed to the test script steps (import and export parameters), edit the Parameters sub tab page:

      1. In the Usage field, define the usage type:

        • No value: No parameter value is passed to the parameter of the test script. The test script parameter does not have a default value.

        • Fixed: A constant value is passed to the parameter. The constant value does not depend on the execution of the script.

          Example Example

          If you always want to create a sales order for 5 pumps, enter 5 for the parameter Quantity, in the Value column. If you set usage to Fixed but do not enter a value, the value NULL is used in the test script. To define an empty string value, use the value %BLANK%.

          End of the example.
        • Exposed: The parameter is mapped to the parameter of the parent script. The parameter value is passed from (import parameters) or passed to (export parameters) the parameter of the parent script.

          Import parameters can receive the values from the test data container.

          Several exposed import parameters can receive their values from the same parent script parameter.

          A single exposed export parameter can pass its value to several export parameters of the parent script.

          Example Example

          You want to create a main test script comprising 3 steps (scripts) with the following parameters:

          • Create quotation

            Import parameters: Customer, Material, Quantity

            Export parameter: Quotation Number.

          • Create sales order from quotation

            Import parameter: Quotation Number

            Export parameter: Sales Order Number

          • Create delivery from sales order

            Import parameter: Sales Order Number

            Export parameter: Delivery Number

          You put 3 of the steps in the sequence. To be able to execute the main script for a different customer, material and quantity, you have to know the delivery number created at the end. To do so, set the usage type to Exposed for the following parameters:

          • Import parameters Customer, Material, Quantity of the script “Create quotation”

          • Export parameter Delivery Number of the test script “Create delivery from sales order”

          End of the example.
        • Local: The value passed to the parameter is mapped into the parameter of another step. The value actually used during the execution of the test script depends on the execution of the parent script and the values created in the preceding steps.

          Example Example

          You want to pass the value of parameter Quotation Number created by the “Create Quotation” test script step to the “Create sales order from quotation” test script step. To do so, set the usage type to Local and map these 2 parameters between them. To do so, in the Reference Parameter column, assign the name of one parameter to the other.

          End of the example.
      2. Define the other columns as required.

        CBTA uses Unified Resource Identifiers (URIs) to identify the controls on a tested page. To retrieve a URI, choose Get Technical UI Information. For more information, see CBTA 3.0 <SP> - Runtime Library and Default Components at http://wiki.scn.sap.com/wiki/x/kQ_IFQInformation published on SAP site.

    • To display SAP attributes of an eCATT test script or of a test script created with a third-party test tool, choose the Attributes sub tab page under Test Script.

      To change the attributes, under Test Script Steps, in the Name column, select the test script.

    • To display the description, if available, choose the Description sub tab page.

      For test scripts stepscreated with a third-party test tool, to select either the SAP description or the third-party test tool description, select the respective radio button.

    • To display the screen capture of a test script step, if available, choose the Image tab page.

    • To check where a test script is used, select the test script and choose Where-Used..

    • To edit or display a test script step in a new session, in the Name column, choose the test script.

      If the third-party tool in which the script was created is not available, you go to the eCATT wrapper test script.

  6. To execute the test, choose Execute.

  7. If the execution of a CBTA test fails, you can edit the parameters of the screen component, do the following:

    1. Select the component and choose CBTA Inspection.

      You go to the Inspection Wizard screen.

    2. Select the SAP GUI screen, the CRM web client, or the Web Dynpro ABAP view.

    3. To create the screen components, start the inspection process.

    4. In the editor for the test configuration, on the Test Script tab, select the newly created screen component. On the Parameters sub tab, change the parameter values, where necessary.