> ## 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 Visuals in Kane CLI

> Verify what is visible on the screen by analyzing the current screenshot. Request visual assertions explicitly with --assertion-mode visual.

Visual assertions check what is visible on screen by analyzing a screenshot of the current page. The default assertion mode is `dom`, which falls back to vision when needed. To request visual assertions explicitly, set `--assertion-mode visual`.

## When It's Used

* Text content: prices, labels, headings, counts, messages
* Visibility: "is the login button visible", "are search results displayed"
* Color checks using color names: "has red background", "blue text"
* Any content that appears visually on the page

## Examples

### Assertions

```
Assert: the product price is $29.99
Assert: the search results show at least 5 items
Assert: the error message is visible
Assert: the hero section displays "Welcome back"
```

### Extractions

```
Store the product price
Extract the heading text
Get the number of items in the cart
```

### If/Else

```
If the login button is visible then click it, else click Sign Up
```

## How It Works

1. KaneAI takes a screenshot of the current page
2. The AI model analyzes the screenshot to find the requested information
3. KaneAI compares the extracted value with the expected value using the operator you specified

## Best Practices

* Use visual assertions for any text or content you can see on screen
* Be specific about what to look for: "the price in the cart summary" not just "the price"
* For exact CSS values (like `rgb(255,0,0)` or `#ff0000`), use [Textual (DOM)](https://www.testmuai.com/docs/kane-cli-checkpoint-textual.md) instead
* For element states (disabled, checked), use [Textual (DOM)](https://www.testmuai.com/docs/kane-cli-checkpoint-textual.md) instead

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