Example: Linking substitutions to references with rules
You can create data correlation rules to link substitutions to references.
About this task
If you are familiar with the application under test and
know the exact location of the reference in the response data, write
a Create a reference rule that uses a regular expression
to locate the reference data, and then insert a Create a substitution rule
as a child of the Create a reference rule.
Procedure
- Open a data correlation rule set in the rules editor.
A new rule set contains one empty rule pass.
- Create a
Create a referencerule. See Creating a reference using data correlation rules to learn more about creating aCreate a referencerule. - Right-click the Create a reference rule, and then click .
- Right-click the Link with substitutions rule,
and then click . To use
the value of the reference that is extracted by the parent rule, type %refname% for
the Regular expression, where refname is
the name of the reference that is created by the parent rule. See Creating a substitution with data correlation rules to learn more about creating a
Create substitutionrule.ACreate a substitutionrule is inserted as a child of theLink with substitutionsrule.
Results
Example
ID123 value
when the rules run. This regular expression creates substitution sites
in every location where the ID123 value is found
in URIs and in POST data. In this example, three substitution sites
would be created: RPThelpID123, nameID123,
and nameID123=ID123.