Information:

Environment

Dynatrace Synthetic Monitoring - Backbone

  • Dynatrace Recorder

 

 

 

Solution


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:

  1. Set the Criteria to Match against all content loaded during this step.
  2. 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:

  1. Set the Criteria to Match against an element (listed below).
  2. Type the text in the Match Text field.
  3. 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 <span> tags.

Example: CSS span:contains("example text")

 

Goal: Find text located inside the alt attribute of an <img> tag.

Example: CSS img:alt("example text")
or
Example: CSS img[alt="example text"]


Goal: Match against the presence an input (e.g. Save or Submit) button.

Example: CSS input[value="Save"]

 

Goal: Match against the second occurrence on a webpage of a link containing the string "Submit" using the eq locator:

Example: CSS a:contains("Submit"):eq(1)
The index starts with zero (0), so:

  • The first occurrence of the element would be located with eq(0).
  • The second occurrence with eq(1).
  • The third occurrence with eq(2), and so on.

 

You can also match against regular expressions.

Goal: Match a GUID inside <SessionId> tags.

Example: CSS SessionId[^>]+>([^<]+)

 

 

 

 

 

  • No labels