You can define a content match so that when a test downloads a web page, specific content must exist on the page for the text to be successful. When a content match exists, the Browser Agent searches the page's source code for the text. If it finds the text it is looking for, the test continue; if not, the Browser Agent generates an error. A content match is a good way to ensure that your test downloads the page that you expect, and that the page is loaded successfully.
Content matches can be entered as either a straight Text Match or as a Regular Expression pattern. The best string for a content match is a string that is unique to the page (i.e., the string is not found on any other page in your application).
We recommend that you avoid menu options, especially if the menu appears on several pages in the transaction. Don't perform a content match against content that will or might change in the future. Try to use page headers that are unique to the page (as long as that text does not appear in menus or links on other pages), since this text is less likely to be removed from the page.
Use only ASCII (single-byte) characters in the content match string. Although a string containing multi-byte (e.g. Chinese) characters might work, multi-byte characters are not supported by the Dynatrace Recorder and we cannot guarantee correct results.
For pages where finding a content match string is difficult, you can:
- Create multiple content matches for a single page; other pages might contain one of the strings, but not all the strings.
- Use a negative content match. A negative content match will only generate an error if the indicated text is found on the page. For example, you could use a "missing content" error message as the content match string.