Splitting a socket test

After you record a test, you can split it into smaller tests. Splitting tests enables you to create modular building blocks of smaller tests and combine them to make bigger tests. The original test is unchanged. You can recombine these building blocks in a schedule, including loops and conditions.

Before you begin

When reusing split tests in a schedule, you must ensure that the general test structure is consistent including socket connection and close elements. For example, you must ensure that all socket send and receive elements are preceded with a corresponding socket connection and followed by a socket close element. When the split tests are recombined in the schedule, you must place them in the correct order.

Procedure

  1. In the Test Navigator, browse to the test and double-click it. The test opens.
  2. Right-click a socket send or receive element in the test, and select Split Test. The page that you click is the first page of the new test.
  3. In the New Test Names window, confirm the location of the split, optionally provide names and descriptions for the split tests, and click Next.
  4. In the Split Test window, examine the changes to be performed as a result of the split, and click Finish.

Example

For example, you could record a test that contains the following actions:
  • Logging on to a server.
  • Creating an entry on the server and removing the entry.
  • Editing an entry, validating that the change occurred, and restoring the entry.
  • Logging off of the server.
You then split the test into four parts: Logon, Create, Edit, and Logoff. You create a schedule that runs virtual users selected from a dataset. Each virtual user runs the Logon test, performs various combinations of the Create and Edit tests, and finally runs the Logoff test.
Feedback