Example: Linking references to substitutions with rules
You can create data correlation rules to link references to substitutions.
If you know which field in a request or in POST data must be correlated, write a Create a substitution rule for that field, and then insert a Create a reference rule as a child of the Create a substitution rule.
- Open a data correlation rule set in the rules editor. A new rule set contains one empty rule pass.
- Create a Create a substitution rule. See Create a substitution with data correlation rules to learn more about creating a Create a substitution rule.
- Right-click the Create a substitution rule, and then click Insert Item > Find data source for substitution.
- Right-click the Find data source for substitution rule, and then click Insert Item > Create a reference. If the reference exists, select Find a reference instead of Create a reference. A Create a reference or Find a reference rule is inserted as a child of the Find data source for substitution rule. To use the value of the substitution extracted by the parent rule, type %subname% for the Regular expression, where subname is the name of the substitution created by the parent rule. See Create a reference using data correlation rules to learn more about creating a Create a reference rule.
Results
When you recorrelate test data using this rule set, the references and substitutions that you defined are created and linked.
Example
Assume that a URI in the test is http://host:port/RPThelp/index.jsp?topic=datacorrelation.html. Assume that some of the response data from a previous request includes ...<id=2 docHelpName=recordtest> <id=23 docHelpName=datacorrelation> <id=24 docHelpName=rules>.... Write a rule that creates a substitution site in the URI for datacorrelation and sets the substitution name to helpname. Then, add rules that create a reference as a child of the substitution rule. The regular expression for the reference rule is docHelpName=%helpname%>. Thus, the regular expression in the reference rule evaluates to docHelpName=datacorrelation>. This regular expression ensures that the correct reference is linked to the substitution site.
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.