> ## Documentation Index
> Fetch the complete documentation index at: https://www.testmuai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Textual (DOM) Assertions

> Extract data from the DOM (element states, attributes, and computed styles) and assert on values that may not be visible in a screenshot.

***

<Note>
  **Using Claude Code, Cursor, or another coding agent?** Paste this into your prompt to run cross-browser and real-device tests, debug sessions, and wire up CI on the TestMu AI cloud:

  ```
  Read https://www.testmuai.com/support/docs/SKILL.md to set up TestMu AI (formerly LambdaTest) cloud testing.
  ```
</Note>

Textual assertions extract data from the page's DOM: element states, attributes, and computed styles that aren't always visible in a screenshot.

## When It's Used

* Element states: disabled, enabled, checked, readonly, expanded
* CSS properties with exact values: `font-size: 16px`, `opacity: 0.5`, `display: none`
* HTML attributes: `placeholder`, `aria-*`, `data-*`, `class`, `id`, `href`, `src`, `type`, `value`
* Attribute existence: "has placeholder", "has aria-label"
* Exact CSS color values: `rgb(255,0,0)`, `#ff0000`

## Examples

### Assertions

```
Assert: the submit button is disabled
Assert: the checkbox is checked
Assert: the input field has placeholder "Enter email"
Assert: the element has aria-label "Close dialog"
Assert: the font-size of the heading is 24px
```

### Extractions

```
Extract the href of the first link
Store the value attribute of the email input
Get the class of the error message element
```

## When NOT to Use

* For visible text content (prices, labels) → use [Visual](/docs/docs/kane-cli-checkpoint-visual/)
* For color names like "red background" → use [Visual](/docs/docs/kane-cli-checkpoint-visual/) (DOM may return `transparent` or inherited values)
* For network/console/cookie data → use [DevTools](/docs/docs/kane-cli-checkpoint-devtools/)

## How It Works

1. KaneAI captures the DOM snapshot of the page
2. The AI model identifies the target element and extracts the requested property
3. The value is compared against the expected value
