Skip to content

String checks

Testomato allows you to create string checks for two types of page content. Those simple checks can be created for:

  1. HTML on page - represents raw source code that we downloaded from given URL
  2. Text on page - represents just readable text from given URL

String checks

Then you can use following operators:

  • contains - check that downloaded content contains given string with substr() PHP function
  • does not contain - check that content does not contain given string
  • equals - content is exactly same
  • matches - check that content match regular expression with preg_match() PHP function
  • does not match - check that content does not match

Testomato processes and escapes all users inputs including regular expressions. We are using { and } for wrapping your regex and also adding the following Pattern Modifiers:

  • u pattern and subject strings are treated as UTF-8. An invalid subject will cause the preg_* function to match nothing
  • m subject strings are treated as multi-line string

You can debug your regex with https://www.phpliveregex.com/ or https://phphub.net/regex/

HTML on page is content as downloaded from a given url, only encoded to utf8 - it's useful for checking all content including HTML tags or meta information in <head></head>.

Text on page is a subset of HTML on page - we just remove all markup (HTML tags, head, scripts etc.) and then apply all your checks.