Correlating multiple fields in a test

Some tests are structured in such a way that you must correlate data for multiple fields. For example, assume that you plan to datapool an item that a virtual user is buying. For the test flow to be correct, you must also datapool all occurrences of that item in the test. You can find and correlate all instances of that item in one procedure. Typically, you use Find More and Substitute in the Show Datapool Candidates window to correlate data for multiple fields. See Viewing datapool candidates when you open a test. Alternatively, you can use the Test Search page to correlate data for multiple fields.

Procedure

To find all instances of a field in a test and correlate some or all of the instances with a data source, such as a datapool:

  1. In the Test Navigator, browse to the test, and double-click the test. The test opens.
  2. Locate the item or the substitution site to change or create a reference for. If the item is plain text, select the item. If the item is an existing reference, click the highlighted area.
  3. Right-click, and then click Find > More Substitution Sites.
  4. Click OK.
  5. On the Test Search page, select Case sensitive to perform a case-sensitive search or Regular expression to perform a search using regular expressions. In regular expression mode, press Ctrl+spacebar key in Search for text for content assistance. Content assistance lists the regular expression patterns and the content that they match.
  6. Click More Options, and then select the appropriate options:
    Restrict to elements highlighted in Test Contents
    Search only in elements that are selected in the Test Contents area.
    Highlight found elements in Test Contents
    Highlight found elements in the Test Contents area.
    Recursive
    Searches the child test elements in addition to the element. For example, if you search an HTTP page, select this option to search the requests and responses within the page.
    Match encoded and decoded values (protocol-specific)
    When selected, searches for matches of the unencoded and URL-encoded versions of the specified text. For example, when searching in HTTP data, abc%123 and abc%25123 match.
    Include matches with overlapping data correlation
    Include sites that are contained in, or overlap with, an existing substitution site. If you decide to substitute, the conflicting substitutions are automatically removed.
    Include matching substituters
    Click to return elements that originally matched the search string but have since been substituted. Clear to skip existing substitution sites when results are returned.
  7. Click Close.
  8. Click Search. The search results are displayed in the Search view.
  9. In the Search view, select the matches to substitute, and then right-click the selection.
  10. Optional: To select all matches, right-click the test name.
  11. Click Substitute in DataSource View. This action sends the selected matches to the Test Data Sources window.
  12. In the Test Data Sources window, click the tab that corresponds to the type of data source to use:
    Option Description
    References The data sources that have already been created in the test and the possible matches that are available as data sources for the selected substitution site. For example, text that is found in a response and used in a subsequent request is automatically created as a reference. Clear the Matching References Only check box to see all the references that occur before the substitution site in the test.
    Datapools The datapools that have been added to the test. To add a new datapool, click the Add new Datapool icon (add new datapool).
    Custom Code If you have written test execution services (TES) custom code, the custom code that is available as data sources for this substitution site.
    Test Variables The test variables and their types that are available as data sources for this substitution site.
    Built-in Datasources The dynamically calculated data sources (Current Date, Random Number, Sequential Number, and Timestamp) that are available for this substitution site. To create a new built-in data source, right-click inside the Built-in Datasources page, and select New.
  13. Select the data source, and click Substitute From. The Substitute Multiple Items window is displayed, showing information about the data source and substitutions sites that you selected.
  14. For each site with a selected check box, click Substitute Checked to substitute the data source or clear the check box to skip the site. Click Always Prompt to examine every substitution site one at a time. Click Prompt on overlapping data correlations to examine a site only if the site you are substituting into is contained in, or overlaps with, an another substitution site. If you decide to substitute, the conflicting substitutions are automatically removed.

Results

The selected instances of the field are correlated with the data from the data source.
Feedback