> ## 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.

# How to Assert DOM Values in Kane CLI

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

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](https://www.testmuai.com/docs/kane-cli-checkpoint-visual.md)
* For color names like "red background" → use [Visual](https://www.testmuai.com/docs/kane-cli-checkpoint-visual.md) (DOM may return `transparent` or inherited values)
* For network/console/cookie data → use [DevTools](https://www.testmuai.com/docs/kane-cli-checkpoint-devtools.md)

## 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

## Terminal First Testing With Kane CLI

Natural language browser & mobile app tests right from terminal.

Book a Demo

![Kane CLI terminal](https://assets.testmu.ai/resources/images/Terminal-KaneCLI.png)

×

Schedule Your Personal Demo

<form>
  Select Product

  Schedule Demo
</form>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.