> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/recording-tests-steps/recording-assertions.md).

# Recording assertions

Learn what an assertion is and how to use it during recording your test with BugBug. Use assertions to check if your page behaves as it should, without interacting with it.

## What is an assertion?

You assert that some condition is met, and if it isn't, the test should fail.

## How to record an assertion?

You can add more advanced assertions manually - learn more about [assertions and their types](/editing-tests/assertions.md).

1. Start [recording test steps](/recording-tests-steps/bugbug-ai-test-recorder.md)
2. Click `Add assert`
3. Click the element that you want to check: every time the test is run BugBug will check if this element contains the same text or is visible on the page

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FajwinFAOINHq2qLaqh0d%2F1_addAssert.png?alt=media&amp;token=9f838c72-6f8c-4a26-ba67-18baf68696a7" alt=""><figcaption><p>Add assert option on the recorder</p></figcaption></figure>

You can also enable the "**Add multiple**" toggle, to select various elements on the page at once. Such as checking if all the elements are in place in the main navigation menu.

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2F5YreiKV1kPtiMmrx5oIz%2F2_addAssert.png?alt=media&amp;token=66ab7376-1ec0-4cdc-8fad-ca54263b2b5f" alt=""><figcaption><p>"Add multiple" toggle disabled</p></figcaption></figure>

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FTnK4M4NPuk9V9MWlOfsm%2F3_addMultipleAssertions.png?alt=media&amp;token=c1b451de-692a-47f3-be3d-d3ec160d9bd7" alt=""><figcaption><p>"Add multiple" toggle enabled</p></figcaption></figure>


---

# 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://docs.bugbug.io/recording-tests-steps/recording-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.
