# Assertions for Web Tests

Add assertions to Endtest Web Tests: assert element presence, text, attributes, URL, accessibility, and natural-language conditions with AI Assertions.

Part of the Endtest documentation (Web Tests). Canonical URL: https://endtest.io/docs/web-tests/assertions-for-web-tests

---
## Introduction

We need assertions in order to know if our test execution was successful or not.

If we do not add assertions in our test cases, the values for `Passed` and `Failed` will be zero.

A test case can have more than one assertion.

## Solution

Assertions can be added by using the `Add Assertion` action.

You can choose from the following types of assertions:

| Assertion Type                     | Description                                                                         |
|------------------------------------|-------------------------------------------------------------------------------------|
| Element Is Present                 | Checks if an element is present.                                                    |
| Element Is Not Present             | Checks if an element is not present.                                                |
| Element Is Visible                 | Checks if an element is visible.                                                    |
| Element Is Not Visible             | Checks if an element is not visible.                                                |
| Element Is Clickable               | Checks if an element is clickable.                                                  |
| Element Is Not Clickable           | Checks if an element is not clickable.                                              |
| Element Matches Value              | Checks if the text from an element matches a certain value.                         |
| Element Does Not Match Value       | Checks if the text from an element does not match a certain value.                  |
| Element Contains Value             | Checks if the text from an element contains a certain value.                        |
| Element Does Not Contain Value     | Checks if the text from an element does not contain a certain value.                |
| Element Contains CSS Class         | Checks if an element contains a certain CSS Class Name.                             |
| Element Does Not Contain CSS Class | Checks if an element does not contain a certain CSS Class Name.                     |
| Element Contains Attribute         | Checks if an element contains a certain attribute.                                  |
| Element Does Not Contain Attribute | Checks if an element does not contain a certain attribute.                          |
| Count Child Elements               | Checks if the number of direct child elements matches a certain number.             |
| AI Assertion                       | Validate anything using plain English. Details in the [AI Assertions](https://endtest.io/docs/advanced/ai-assertions) chapter. |
| Accessibility Check                | Run accessibility checks against the page. Details in the [Accessibility Testing](https://endtest.io/docs/web-tests/accessibility-testing) chapter. |
| Variable Assertion                 | Provides multiple ways to check a variable.                                         |
| Title Contains Value               | Checks if the title of the web page contains a certain value.                       |
| Title Does Not Contain Value       | Checks if the title of the web page does not contain a certain value.               |
| URL Contains Value                 | Checks if the URL of the web page contains a certain value.                         |
| URL Does Not Contain Value         | Checks if the URL of the web page does not contain a certain value.                 |
| Page Source Contains Value         | Checks if the Page Source of the web page contains a certain value.                 |
| Page Source Does Not Contain Value | Checks if the Page Source of the web page does not contain a certain value.         |
| Cookies Contain Value              | Checks if the Cookies contain a certain value.                                      |
| Cookies Do Not Contain Value       | Checks if the Cookies do not contain a certain value.                               |
| Browser Logs Contain Value         | Checks if the Browser Logs contain a certain value.                                 |
| Browser Logs Do Not Contain Value  | Checks if the Browser Logs do not contain a certain value.                          |
| Visual Assertion                   | Performs a visual comparison between the page, a section, or an element and a baseline screenshot. Details in the [Visual AI](https://endtest.io/docs/advanced/visual-ai) chapter. |

[Video](https://endtest-videos.s3-us-west-2.amazonaws.com/documentation/endtest_add_assertion_web_test.mp4)
