Some tests are structured in such a way that
you must correlate data for 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. 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:
- In the Test Navigator, browse to the test, and double-click
the test. The test opens.
- 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.
- Right-click, and then select .
- Click OK.
- 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, type Ctrl-Space in Search for
text for content assistance. Content assistance lists
the regular expression patterns and the content that they match.
- 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 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.
- Click Close.
- Click Search. The search results
are displayed in the Search view.
- In the Search view, select the matches
to substitute, and then right-click the selection.
- Optional: To select all matches, right-click the test name.
- Click Substitute in DataSource View. This action sends the selected matches to the Test
Data Sources window.
- 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 ( ). |
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. |
- 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.
- 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.