You can create a data correlation
rule that creates reference from a regular expression when the rule
is applied to test data.
Procedure
- Open a data correlation rule set in the rules editor. A new rule set contains one empty rule pass.
- Click Insert, and then select Create
reference. An empty Create reference rule
is inserted in the rule pass.
- Under Details, supply information for all fields
that are marked with asterisks and shaded in red. For Attribute,
click the down arrow to select the attribute in which to create the
reference. Use the push buttons at the top of the window to select
a protocol, and then select an attribute. To create a reference in
the content field of an HTTP response, click the down arrow, and then
click .
- In Regular expression type an expression
to use to locate the reference. If only a part of the regular expression
is required for a reference, enclose that part in parentheses.
- Open the test and locate the request where you want
to create the reference.
- Copy the text from the request to the clipboard.
- In the rules editor, click the Toggle regular
expression assistant push button to open the regular expression
assistant.
- Paste the text from the clipboard to the Test
regular expression page of the regular expression assistant
window. If the Test regular expression page
is empty, the contents of the clipboard is automatically pasted in.
- Click the Captured group tab
in the regular expression assistant. The overall
group is displayed, and the captured groups are displayed. If no groups
are displayed, edit the regular expression accordingly.
- In Base name provide a name for
the reference.
- Optional: If the regular expression matches
multiple groups, in Value group, type or select
the index of the value group to use to create the reference.
- Under Remove overlap,
select true to create a reference even if the
new reference overlaps with other references. The other references
are removed. Select false to prevent a reference
from being created if the new reference would overlap with a current
reference.
- If an attribute contains multiple
matches for the regular expression, in Occurrence type
or select the occurrence to use to create the reference.
- In Log level,
select the level of error data to be written to the error log. Logging
lets you see which rules worked and which did not. When you are debugging
data correlation rules, use the Action and Detail log
levels. Typically, when you are sure the data correlation rules that
you have written work correctly, use the None or Summary log
levels to reduce memory and disk-space consumption and unnecessary
entries in the error log.
Option |
Description |
None |
Nothing is logged. |
Summary |
One message is logged for the rule, no matter how many times
the rule is applied. |
Action |
A message is logged every time the rule is applied. |
Detail |
A detailed message is logged every time the rule is applied. |
- In Label,
type a label for the rule. If you do not type a label name, the rule
is given a default name. The default name is the base name with the
regular expression appended.
- In Description,
describe the rule. Descriptions can be useful if you share rule set
files with other testers.