Validate Web Pages

Applies to TestComplete 15.47, last modified on January 20, 2023

The information in this topic applies both to cross-platform and classic web tests.

Before making your web site or web application public, you may want to validate the mark-up of its pages, check it for broken links, and check whether the pages contain certain text and so on. The following sections describe how you can automate the checking and validation processes using checkpoints:

About

When testing web pages, you usually need to check different characteristics of web pages and their elements. With TestComplete, you can access web page elements, their properties, attributes, and methods and check any web page contents.

TestComplete includes a number of built-in checkpoints that enable you to verify various characteristics of a web page and its elements. You can create the checkpoints in keyword tests and scripts when recording a test and at design time.

You can use any available checkpoints with your web pages. The commonly used checkpoints for web objects include:

  • Property checkpoints - verify web object properties.

The property checkpoints are performed on the device where the web test is running.

The following checkpoints are always performed on your local computer (even if your web test is running in a remote environment):

  • Table checkpoints - verify tabular contents.

  • Web accessibility checkpoints - verify whether the web page complies with the Web Content Accessibility Guidelines rules.

  • Web comparison checkpoints - verify web page contents.

  • Web Audits checkpoints - verify whether the web page complies with specified thresholds.

If needed, you can also use any other checkpoint for testing your web pages. For a full list of the available checkpoints and their detailed description, see the About Checkpoints topic.

Verifying Web Element Properties

To verify the value of a web element’s property, you can use a property checkpoint. When creating a property checkpoint, you specify the desired web element whose property you want to check and then select the property to verify. Then, you specify verification parameters and the expected value.

In cross-platform web tests, you can only verify properties common for all visual objects. Attributes and native web properties are not available in such tests.
In web tests that implement the default approach, the Checkpoint wizard shows native attribute and properties in the More Properties mode. In addition, the Checkpoint wizard does not show custom web attributes. You have to type the name of the element’s needed attribute manually.

For a detailed description of creation of property checkpoints, see About Property Checkpoints.

Verifying the Tabular Content

Another typical task is verifying the tabular content by comparing the actual content with a baseline copy. For this, you use table checkpoints. You can verify the contents of

Tip: To check the contents of TABLE elements, you can use the optical character recognition. Create a tabular checkpoint that will recognize the text contents of the needed element and compare it against the expected baseline data. To learn how to create such checkpoints, see Creating Table Checkpoints.

For a detailed description of creating table checkpoints, see About Table Checkpoints.

Verifying Web Page Accessibility

You use Web accessibility checkpoints to verify a web page’s conformance to Web Content Accessibility Guidelines. A web accessibility checkpoint includes typical verification actions such as checking the ALT attribute, checking tab indexes, checking for broken links and so on. For a complete list of the available verification actions, see Web Accessibility Checkpoint Settings.

Verifying Web Page Contents

To verify a web page against a baseline copy, use the web comparison checkpoint. You store the baseline copy of a web page to your TestComplete project. You can easily compare the whole HTML document, the tag structure of the specified page or the specified tags. For a detailed description, see About Web Comparison Checkpoints.

Performing Web Page Audits

You can quickly estimate the quality of your web page by using the Web Audits checkpoint. For example, you can check the page performance or its search engine optimization. For a detailed description, see About Web Audits Checkpoints.

Further Reading

See Also

How To
About Checkpoints

Highlight search results