Validation actions in the Dynatrace Recorder search for a match between the criteria you have listed in the script, and the content of the page.
After recording a script, hover over the small vertical line between the actions where you would like to insert the Validation action until a plus symbol ( + ) appears. Click the plus symbol to display the action list, then select Validate from the list.
Normally you would insert the Validate action after a Wait action.
Validation is case-sensitive.
Match Text on the Page
To match text that is expected to appear anywhere on the page:
- Set the Criteria to Match against all content loaded during this step.
- Type the text string in the Match Text field.
Match Text inside a specific Element on the Page
To match text that appears in a specific element on the page:
- Set the Criteria to Match against an element (listed below).
- Type the text in the Match Text field.
- Click the + button to add a locator. See the example locators below.
CSS locators are preferred over DOM locators whenever possible.
Goal: Find text located inside
CSS span:contains("example text")
Goal: Find text located inside the
alt attribute of an
CSS img:alt("example text")
CSS img[alt="example text"]
Goal: Match against the presence an input (e.g. Save or Submit) button.
Goal: Match against the second occurrence on a webpage of a link containing the string "Submit" using the eq locator:
The index starts with zero (0), so:
- The first occurrence of the element would be located with
- The second occurrence with
- The third occurrence with
eq(2), and so on.
You can also match against regular expressions.
Goal: Match a GUID inside