Adding templates for new elements

You can add a template for a new test element that you plan to write by hand.

Procedure

To add a template for a page, page request, or basic authentication block to a test:
  1. Open the test. If you are writing a test completely by hand, you can create an empty test as explained in Creating an empty test.
  2. Click the parent or sibling element.
  3. Click Add or Insert.
    The editor enforces the test hierarchy: tests contain pages, pages contain requests, and requests contain authentication blocks.
    • Add adds the template to the bottom of the selected element: a page is added to the bottom of the test, a request is added to the bottom of the selected page, and an authentication block is added to the end of the selected page request.
    • Insert inserts the template at the point of the cursor: a page is inserted before the selected page, a page request is inserted before the selected request, and an authentication block is inserted at the top of the selected page request.
  4. Select one of the following options. The options that are displayed depend on the element that you select.
    OptionDescription
    HTTP Page Adds a page to the test.
    HTTP Request Adds a request to the test.
    Basic Authentication Adds an authentication block to a request. A folder named Authentication is added, and the Test Element Details area displays the User id, Password, and Realm fields.
    Custom Code Adds a block of custom code to the test. For more information on custom code, see Extending test execution with custom code.
    Delay Adds a delay to the test.
    Loop Runs part of the test a specific number of times. In addition to setting the number of iterations, you can control the rate of iterations and randomly vary the delay between iterations. For more information, see Extending test execution with custom code.
    Condition Adds a conditional block to the test. In most cases, a conditional block issues HTTP requests depending on the value of a reference or field reference. The reference or field reference must exist in the test and precede the conditional block. For more information, see Adding conditional logic.
    Transaction Enables you to view performance data about the transactions that you have added. In the Test Element Details area, give the transaction a meaningful name. This is useful in the Transactions report, which lists transactions by name. For more information, see Adding a transaction to a test.
    Random Selector Enables you to run test elements in random order. For more information, see Running test elements in random order.
    Comment Adds a comment that appears in the Test Element Details area and in the actual test.