Creating test resources from recorded events

After events are recorded in a monitored operation, you can create a test, stub, trigger, requirement, operation, or test data sources from selected events in the Events View.

About this task

While creating tests, you can create a test or a parametrized Test. While creating stubs, you can create a stub, parameterized stub, or data model stub. You can also add an event to an existing test or stub.

Procedure

  1. Select one or more recorded events in the Events View. Use Ctrl or Shift to select multiple events, or click one event and drag over the other.
  2. Use the test resource icons on the toolbar to do specific tasks. The tasks that you do depend on whether the selected events are message-based events, or JDBC or SQL events, or a combination of both.
    • For message-based events, all of the test resource icons are available.
    • For JDBC or SQL events, you can only save an event and create a performance profile from selected events.
    • For a combination of events, all test resource icons are available. However, non-message-based events are filtered and not available for further actions, such as when you save the events as a stub. Also, when you save the events to a test, the test will comprise both message- and non-message-based events.
    Icon on the Events View toolbar Purpose
    Create test icon To create a test
    Create stub icon To create a stub
    Create trigger icon To create a trigger
    Create message icon To create a requirement
    Create operation icon To create an operation
    Save Events icon To create a test data source, click this icon and then select an option in the Resource Type dialog box. The availability of the resource type options depends on the type of messages selected:
    • If all of the selected events are message-based, all of the resource type options are enabled.
    • If JDBC or SQL events are present in the selection, you can choose from among only the following resource types: unit tests, integration tests, performance profiles, and test data sets.
  3. Click Next. The Data Storage dialog box is displayed. Specify whether the data should be stored as hard-coded values or in a simple data set.
  4. Click Next. The Operations Assignment dialog is displayed.

    When you create a resource from a reply message in HCL OneTest™ API versions earlier than 9.0, if the reply has no associated request (or a request message has no associated reply), an error is displayed. From version 9.0 onwards, when a selected event does not have the corresponding request or reply message, you are prompted for an action to take:

    Create Operation warning message.

    Depending on the type of the recorded events, the following scenarios apply:
    • Incomplete, but all legal transactions - for example, only request messages. In this case, you can add the completing messages by clicking Add Matching.
    • Incomplete transactions, but no complete ones. In this case, you can add the completing messages by clicking Add Matching.
    • A combination of incomplete and complete transactions. In this case, you can either add the completing messages by clicking Add Matching or remove the incomplete ones by clicking Remove Unmatched.
    • Incomplete transactions only and the application cannot find any matching ones that can be added. In this case, you can only cancel the operation by clicking Cancel.
  5. Click Next. On the Header Transformation page, change any assignments, if necessary.
  6. Select the operation where the resources are to be saved and provide a name or prefix for the new resources. When creating tests or stubs, you provide a name because only one test or stub is created from one or more recorded events. When creating triggers, test data sources, or requirements, you provide a naming prefix, because one trigger, test data source, or requirement is created for each selected event. To open the new resource for editing after it is created, select the Open resource after finish check box.
  7. Click Finish.

Results

The new resource is created under the selected operation and opened for editing.

Feedback