Example: Link substitutions to references with rules
You can create data correlation rules to link substitutions to references.
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.
- Open a data correlation rule set in the rules editor.
A new rule set contains one empty rule pass.
- Create a reference rule.
- Right-click the Create a reference rule, and then click...
Insert Item | Link with substitutions
- Right-click the Link with substitutions rule, and then click...
Insert Item | Create a substitution
To use the value of the reference extracted by the parent rule, type %refname% for the Regular expression, where refname is the name of the reference created by the parent rule.
A Create a substitution rule is inserted as a child of the Link with substitutions rule.
Results
When you recorrelate test data with this rule set, the references and substitutions that you defined are created and linked.
Example
Assume that a response in the test data contains an ID present in URIs and in POST data throughout the test. For example, the response includes...
<NeededID=ID123 docHelpName=rules>
Assume that a URI in the test is...
http://host:port/RPTHelpID123/index.jsp?topic=datacorrelation.html
...and the POST data includes...
nameID123=ID123
Because you know the exact location of the ID in the response, you can write a rule that creates a reference for the ID. Specify the Reference name as ID. Then, add rules for two substitutions as children of the reference rule. Add one substitution with a URI attribute and one with a data attribute. Specify %id% in Regular expression for both substitution rules. Thus, the regular expression in the substitution rule becomes the 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
- nameID123=ID123
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.