Specifying the expected content for multiple requests

Content verification points verify that the response contains—or does not contain—an expected string. If the content returned is unexpected, the test log returns a failed verdict event. You can advance through a test and create content verification points in multiple requests, or in the entire test.

Procedure

To create content verification points in multiple requests:
  1. Adjust the verification point scope. The default is to create content verification points in primary requests only and to skip responses with binary contents. Click Window > Preferences > Test > Test Editor > HTTP Test. Select or clear Skip responses with binary content and Create only in primary responses as needed.
  2. In the Test Navigator, browse to the test and double-click it.
    The test opens.
  3. Right-click the test name, a test page, or a request, and select Verification Points > Enable Content VPs.
    Your choice determines whether the verification point is added to all test pages, to a page in the test, or to a particular request. Confirm that you want to modify the test elements, and click OK.
  4. In the Create/Enable Content Verification Point window, set Verification fails if to either At least one of the checked strings is found or to None of the checked strings are found.
  5. In the list of strings in the Text column, select the strings that the content verification point should search for.
    • If you are editing an HTTP test, the window lists user-defined strings.
  6. To create a new string from scratch, click New String. To create a new string by editing another string, click it and click Duplicate. To edit an existing string, click Edit. To remove a string, click Remove.
  7. Optionally, insert a regular expression into the verification point. The most common regular expressions are * for any number of characters, ? for any single character, and \ for an escape to enter literals. For detailed information on Java regular expressions, see the Java documentation.
  8. The Create/Enable Content Verification Point window advances through the requests. The preference settings that you selected in the first step determine whether secondary requests and requests containing binary data are affected. Select one of the following:
    OptionDescription
    Skip Advances to the next request without inserting a verification point in the current request.
    Enable Inserts a verification point into the current request and advances to the next request.
    Enable All Inserts a verification point into every test request (if the scope is the test) or every page request (if the scope is a page).
    By default, a string that you set for a content verification point is available to all tests. To make the string available only to a specific test, or to clear the list of strings displayed when you create a verification point, change the preferences in the Content Verification Points section of Window > Preferences > Test > Test Editor > General.