Correlating multiple fields in a test

Some tests are structured in such a way that you must correlate multiple fields. For example, assume that you want 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.

About this task

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, do the following:

Procedure

  1. In the Test Navigator, browse to the test, and double-click it. The test opens.
  2. Locate the item or the substitution site to change or create a reference for.
  3. Right-click the field, and then click Find > More Substitution Sites.
  4. Click OK.
  5. On the Test Search page, select the appropriate options:
    Restrict to elements highlighted in Test Contents
    Search only in elements that are selected in the Test Contents area.
    Case Sensitive
    Indicates that the search is case-sensitive.
    Highlight found elements in Test Contents
    Highlight found elements in the Test Contents area.
    Recursive
    Searches the children of the test element 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.
    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.
  6. Click Search. The search results are displayed in the Search view.
  7. In the Search view, select the matches to substitute, and then right-click the selection.
  8. Optional: To select all matches, right-click the test name.
  9. Click Substitute in DataSource View. This action sends the selected matches to the Test Data Sources window.
  10. 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 potential 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 Variables The dynamically calculated variables (Current Date and Timestamp) that are available as data sources for this substitution site. To create a new built-in variable, right-click inside the Built-in Variables page, and select New.
  11. 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.
  12. 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 existing 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