Show TOC

Procedure documentationRecording a Test Script Using Component-Based Test Automation

 

You can record business scenarios and create automated test cases with component-based test automation.

You can create tests and components from the screens of a transaction, and parameterize them. These tests are for a single transaction and can be combined into a scenario test. You maintain the components in the test composition environment.

Note Note

You can test the following types of applications:

  • SAP ABAP servers:

    • SAP GUI

    • SAP CRM Web Client

    • Web Dynpro ABAP

    • Business Server Pages (BSP)

    • Web GUI (SAP GUI for HTML)

  • SAP Java servers:

    • SAP Portal

    • Java Web Dynpro

  • Web servers:

    • URL (HTML pages)

    • SAP UI5

End of the note.

Note Note

There are limitations to the scope of CBTA. For more information, see SAP note 1835958Information published on SAP site.

End of the note.

To cover special use cases, you have the following options:

  • To compose tests manually, to reuse parts of existing tests, or modify tests (add certain conditions, for example), you can create screen components for ABAP Web Dynpro applications.

    For more information, see “ABAP Web Dynpro Screen Components”.

  • To retrieve information from a message that the application displays in the message area, you can the default component CBTA_WEB_A_GETMESSAGEPARAMS. You add it to the generated test script, manually.

    For more information, see “CBTA 3.0 SP02 – Working with Message Parameters” (http://service.sap.com/~sapidb/011000358700000195142014E.PDFInformation published on SAP site) on SAP Service Marketplace at Start of the navigation path http://service.sap.com/testingInformation published on SAP site Next navigation step Media Library Next navigation step Test Management End of the navigation path.

Prerequisites

Procedure

  1. Save your entries.

  2. Choose Launch CBTA.

  3. Logon to the system under test.

    The Test Creation Wizard starts.

  4. Optional: Replace the default analysis name with a more meaningful one.

  5. To confirm, choose Next.

    The executable starts. The Test Creation Wizard is in recording mode.

  6. Perform the business process.

  7. Optional: To add a checkpoint, do the following:

    1. In the Test Creation Wizard, choose Add Checkpoint.

    2. Click the UI control to be checked.

      The UI control is listed in the test creation wizard.

    3. Optional: Change the property to be checked.

      When changing this property, its value is displayed.

    4. Optional: Change the operator and value to be checked.

  8. Optional: To add a screenshot to the execution report, choose Insert Screenshot.

  9. To stop the recording, in the Test Creation Wizard choose Stop the PFA and validate.

  10. Choose Next.

    The structure of the process flow is displayed.

  11. Verify that the business process has been recorded correctly and completely .

  12. To create the test, choose Next.

    To cancel the recording, choose Cancel.

    The test script and test components required are generated and uploaded to the SAP Solution Manager.

  13. Choose Finish.

  14. In the test composition environment, choose Refresh.

    The test composition environment is updated with the results of the recording. The test script parameters, if defined, are displayed on the Parameters tab page.

Creating Checkpoints
  1. To define a checkpoint, choose Add Checkpoint in the test creation wizard for recording.

  2. In the tested application, select the UI element to be checked.

  3. In the test creation wizard, a new line has been added to the list of steps. The list of properties that can be checked is automatically retrieved according to the UI element type.

  4. If the UI element is still visible in the tested application, the value of the property selected in the wizard will be automatically filled and updated.

  5. Select the checkpoint type:

    • Check Data: If you want to perform a check, select Check Data. Under Parameters, select the operator of the check to perform. You can set a value for the check or keep the default, which is retrieved only if the UI control that is targeted by the check is still available in the tested application. If the tested application is updated asynchronously, select Data Updated Asynchronously under Options, to perform the check repeatedly until it succeeds or until a timeout is reached. Use this option when the test execution must wait for an unknown time, for example until a background job has finished. When this option is selected, you can set some additional parameters under Options:

      • Initial Wait Time: The time to wait before the first execution of the check.

      • Interval: The time to wait between two executions of the check.

      • Timeout: The total time during which checks will be performed.

      The Options field under Parameters is automatically updated according to the value of these parameters. This value is set for the OPTIONS parameter of the CBTA_WEB_CHECKPROPERTY default component instance, which will be inserted in the generated test. You can also define this value later in the test composition environment.

    • Get Data: If you only need this checkpoint to make the UI element property value available for another step, set the checkpoint type to Get Data. No check is performed. You do not need to define an operator and a value, so these fields are disabled under Parameters. A CBTA_WEB_GETPROPERTY (or CBTA_WEB_GETATTRIBUTE) default component is inserted in the generated test. An output parameter exposes the value of the selected property for the targeted UI element. This value is also stored in the execution context.

Other Functions
  • Adding Screenshots: To make the report of the execution of a test more readable, you can insert some instances of the default component CBTA_WEB_CAPTURESCREEN in the test during recording. To append the screenshot step to the recording, choose Add Screenshot. Alternatively, right-click a step under Steps and choose Insert Screenshot. A new step for a screen capture is inserted under Steps.

  • Removing Steps: Select a step and choose Remove to delete a step from the current recording. Note that this can result in a non-executable test if you remove a mandatory step.

  • Pausing: To pause a recording, choose Pause. To continue, choose Resume.