Creating a reference or field reference
When you designate a test value as a reference or designate a set of test data as a field reference, you can use the data elsewhere in the test.
About this task
A reference, which is typically located in response data, points to a specific value that you want to use in a subsequent test location, typically a request. You can substitute a request value with a reference. This substitution is called data correlation. You can also use a reference as input to an IF-THEN condition in a test or as input to custom Java™ code that your test calls.
A field reference points to an entire block of test data. For example, an entire HTTP response can be designated as a field reference. You can use a field reference as input to custom Java™ code that your test calls.
Procedure
- In the Test Navigator, browse to the test, and double-click it. The test opens.
- Locate the value or set of data to designate as a reference
or field reference.Different protocols support different references. For HTTP tests, you can create references and field references in these fields:
- A response header value, the Value column of a Response Headers table
- Response content, the Content field
- The Status field
- The Reason field
- Create the reference:
Note:
A reference that is created to be used by the HTTP secondary request cannot be used by custom code or other data sources.
If you select the Always log details checkbox, the details will be logged irrespective of the logging level set for a schedule. You must use this option only for debugging purpose.
You can always log the details of Substituters, Data Sources, and Requests.
- To create a field reference, do not highlight the value.
Instead, right-click the value, and then click Create Field
Reference.
- Field references are not automatically given names. To name a field reference, right-click the field reference, and then select Properties. Type a name in the Name field, and then click OK.
The entire field is highlighted in yellow to indicate that it is a field reference.