Of all the checks available in Testomato, monitoring strings is one of our most versatile features. It’s also one of the features that often gets overlooked.
A text string is a piece of text that appears on a web page. With Testomato, you can check for the presence of a specific text string or make sure a piece of text that shouldn’t be there is not present.
There are a lot of ways to use strings in your checks that might not be obvious. With that in mind, we decided to pull together a few was you can use strings to monitor your website.
Important note: This post was updated in July 2015.
How to Check Strings in Testomato
- Click on the project you’d like to view or select a project from the All Projects menu in the top right corner.
- Click Add test and enter the URL of the page you’d like to monitor. You can also edit a check by clicking on the gear icon on a check box.
- Name your test and click Next.
- Set up test expectations for HTML on Page contains and click Save. You can add another rule by clicking on Add Rule.
- Copy or type in the text string you’d like to test for.
- Click Save.
A few more important tips:
- These tests are case sensitive, so make sure you PaY ClosE AtTentioN to the text you enter!
- You can enter HTML content on a page. (e.g.
<h1>Your Cool Title</h1>)
- You can check more than one string by creating multiple lines of text separately (i.e. you don’t need to create a separate rule for each string).
7 Ideas for Ways to Use Strings
1) Correct Content in URL
You can check that the right content shows up in the URL of a web page (e.g. H1 content).
2) Google Analytics
Find the tracking code or property ID of your Google Analytics account on your website.
Enter your ID: UA-xxxxxx-x
3) Important Page Elements
Make sure the most important elements of a page are working properly.
4) Form Results
Monitor your forms by checking form results. For example, you can check for a search phrase in a search form. You can also check for success messages from a signup or login form.
5) Error Messages
You can also use string checks by creating a Rule for various error messages you do not want to be found on the page.
6) Login Forms
Test to make sure the data of a login form can be submitted correctly by checking to make sure that it isn’t present anymore on a page.
7) HTTP Header Testing
You’ll be able to test for HTTP headers to ensure that an application is responding, the correct cookie is served, or an API returns the correct content-type (e.g. application/JSON).