Creating tests from recorded events
Tests can be created by using events that are captured in the Recording Studio.
Procedure
- In Recording Studio, select one or more recorded events in the Events View.
- Click the Create Test from selected
events icon in the Events View toolbar, or right-click
the messages and select Create Test or Create
Parameterized Test from the menu.If you use a tag reference from a promoted column as part of the test name (for example, col = %%Col A%%), grouping is enabled as follows:
- The cell from any promoted column that does not contain a value inherits its value from the first non-null value above it.
- All rows that share values belong to the same group.
- If more than one tag name is used in the name, uniqueness is applied to the applicable columns
- Each group produces a set of tests (unit, or integration, or both).
- Generated tests are driven from only the subset of events that are defined in each group.
-
On the Resource Type page, select one of the following test
types:
- To create a test that is based on the actions in the selected events.
- To create a test that is based on the MEP types of the selected operations.
-
Messaging events can be added to existing stubs. JDBC events can be added to existing tests. The appropriate resources are displayed in the Browse dialog. Select the resource to add the events to.
- Click Next.
- On the Data Storage page, choose one
of the following methods for storage:
- as hard coded values
- Create one or more test messages with hardcoded values from the events.
- in a simple data set
- Create one or more test messages with tags. The tags refer to a new data set that has the same name as the base name of the message and that contains the values from the events.
- in a data model
- This option is not available for tests.
Click Next.
- On the Operation Assignment page, you can change the default names assigned to the displayed operations. Click Next when you are finished.
- If you are creating a data set, the Transaction Assignment page is displayed. Group events together that represent a single transaction by selecting events and clicking Group or Ungroup. Click Next when you are finished.
- If you are creating a data set, the Column mapping pages are displayed, one page for each event. Double-click the displayed column names to change them. Click Next when you are finished.
- In the Header Transformation window, all HTTP headers that were identified in the recorded traffic are displayed. Only those headers that are useful in distinguishing one operation from another are enabled. The remaining headers are disabled to make the message or messages more generic. Change any of these assignments if necessary, and click Next.
- On the Summary page, enter a name for the test. To edit the new test immediately after it is created, select Open resource after finish. Click Finish.
Results
A test is created. The test contains test steps that relate to the selected events. Test steps vary on the type of event.
The following table lists some examples of test steps that are generated from recorded message-based events:
Message event type | Test step | Properties |
---|---|---|
Publish | Publish action |
|
Receive reply | Receive reply action |
|
The following table lists some examples of test steps that are generated from recorded SQL events:
SQL event type | Test step | Properties |
---|---|---|
INSERT, UPDATE or DELETE | SQL Command action |
|
SELECT | SQL Query action |
|
CALL | SQL Command action |
|