> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/en/autify-university/foundation/creating-a-scenario/assertions.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Assertions

## Creating Assertion Steps

Autify allows you to validate certain elements and information on a given page.

There are two types of assertions in Autify:

1. Assertions on elements within a page
2. Assertions against a page

To add an assertion step, click the checkbox button <img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-51d7ec425f10e52f9a4bd21ef73a9e140398a3f4%2FScreen%20Shot%202021-09-29%20at%2011.50.41%20AM.png?alt=media" alt="" data-size="line"> on the Autify Recorder while recording.

### Assertions on elements within a page

To add an assertion step to validate an element in a page, click the checkbox icon in Autify Recorder and mouse over the element you want to validate. The target element will be highlighted with a dark grey rectangle. Click on it, and a list of commands will appear. Select the appropriate command and click the ***\[Save Assertion]*** button.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-a56454a84b6ce8ec173048413b90a4ca35e48051%2FScreen%20Shot%202021-09-29%20at%2012.24.30%20PM.png?alt=media)

Available commands depends on the target element. For more information, please see [this article](https://help.autify.com/nocode-web/en/autify-university/advanced/assertions-1/assertion-elements-on-the-page.md).

### Assertions against a page

To add an assertion step against the page, click the checkbox icon <img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-51d7ec425f10e52f9a4bd21ef73a9e140398a3f4%2FScreen%20Shot%202021-09-29%20at%2011.50.41%20AM.png?alt=media" alt="" data-size="line"> on the Autify Recorder, and click ***\[Assert against page]***.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-9370a9c0ae8dc9bf146d58a396d05be58b8e7706%2FScreen%20Shot%202021-09-29%20at%2011.51.07%20AM.png?alt=media" alt="" width="250">

A list of commands will appear. Select the appropriate command and click the ***\[Save Assertion]*** button.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-530760cbd750fb3abd73d8c1af00d1316a2b5e34%2FScreen%20Shot%202021-09-29%20at%2012.24.48%20PM.png?alt=media" alt="" width="250">

For more information on the available commands, see [this article](https://help.autify.com/nocode-web/en/autify-university/advanced/assertions-1/assertions-against-the-page.md).

{% hint style="info" %}
**Validating pages that uses asynchronous communication, such as SPA**

If the element that you're asserting against doesn't exist on the page, Autify will keep searching for a set amount of time. Therefore, even if a page involves asynchronous communication, as long as the target element appears within that time, you can validate it without a Sleep Step.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/en/autify-university/foundation/creating-a-scenario/assertions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
