# Creating Tests with AI

:::lead
Instead of performing every action yourself, you can describe a test in plain English and let AI carry it out, or ask AI to take over for a tricky part while you're recording.
:::

AI helps you build tests in two places:

- **Describe with AI** on the **Home** page — write a plan, AI performs the whole journey from scratch.
- **Ask AI** inside an open recording — type one instruction at a time while you record.

Both open a real browser session in the **TestOwl Desktop App**, add their actions as ordinary, editable test steps, and still end with you reviewing and saving — AI never saves a test on its own.

## Before you begin

Make sure you have:

- A [project](/docs/getting-started/creating-a-project) where you're an **Editor**, **Admin**, or **Owner**.
- The **TestOwl Desktop App** installed and open — see [The Desktop App](/docs/running-and-results/desktop-app). As with recording, the **Sample Demo Project** and the web-only version of TestOwl can't start an AI session.
- Some AI credits left for the project, unless you're using Claude — see [AI Credits and Usage Limits](/docs/team-and-account/ai-credits).

## Describe with AI (Home page)

Open your project's **Home** page and switch the mode from **Record** to **Describe with AI**.

| Field | What it does |
| --- | --- |
| **Test plan** | Describe what to test, step by step — for example *"Log in as demo@acme.io with password Demo1234, add the first product to the cart, open the cart and check that it shows 1 item."* Up to 4,000 characters. |
| **Run with** | Who carries out the plan: **TestOwl AI** (uses your project's AI credits) or **Claude** (your own connected Claude Code / Claude Desktop, at no credit cost). Only shown once Claude is connected — see [Connect Claude](/docs/integrations/claude-connect). |
| **Protocol** and **URL** | The page the AI starts on, same as a normal recording. |

Click **Create** (or press **Ctrl/⌘ + Enter** in the plan field). The Desktop App opens a browser, and the AI performs your plan step by step inside the **recorder** — you can watch it work, just like a live recording.

:::info{title="If Claude isn't ready"}
If you pick Claude but Claude Code isn't installed or signed in yet, TestOwl tells you so next to the Create button, with a link to **Settings → Connect Claude** to fix it.
:::

## Ask AI (inside a recording)

While a recording is open, use the **Ask AI** box docked above the step list instead of performing an action by hand:

1. Type an instruction, such as *"Log in as a@b.co and open Orders"*.
2. If Claude is connected, pick who carries it out — **TestOwl AI** or **Claude** — from the dropdown next to the box.
3. Click **Ask**.

The AI performs the instruction on the live page, shows what it's doing line by line, and adds each action as a normal step in your recording — editable afterwards like anything else. Click **Stop** at any point to interrupt it.

When it finishes, the panel shows how it went:

| Outcome | Meaning |
| --- | --- |
| **Done** | The instruction was carried out. |
| **Which one?** | More than one element matched — the AI lists the candidates it considered. |
| **Not found** | It couldn't find what the instruction described on the page. |
| **Can't do that** | The instruction isn't something the AI can perform. |
| **Failed** | It tried and hit an error partway through. |
| **Stopped** | You clicked Stop. |
| **Stopped — too many steps** | It hit the safety limit on how many actions one instruction can take. |

## Reviewing and saving

Once the AI finishes — whether from a full plan or a single instruction — the steps it added sit in your recording exactly like steps you performed yourself. Review, edit, reorder, or delete them, then **Save** as a Test Case or Flow the same way as a manual recording. See [Recording a Test](/docs/building-tests/recording-a-test) for the review-and-save flow.

## What it costs

- One **Describe with AI** plan uses one unit from your project's Describe with AI allowance, for the whole session.
- Each **Ask AI** instruction — on Home or inside the recorder — uses one unit from the Ask AI allowance, regardless of how many actions it performs.
- Using **Claude** instead of **TestOwl AI** doesn't touch either allowance.

See [AI Credits and Usage Limits](/docs/team-and-account/ai-credits) for your plan's exact allowances and what happens when they run out.

## Next steps

::::cardgrid
:::card{title="Recording a Test" href="/docs/building-tests/recording-a-test"}
Build a test by performing the actions yourself.
:::

:::card{title="AI Credits and Usage Limits" href="/docs/team-and-account/ai-credits"}
See your plan's AI allowance and how to add more.
:::

:::card{title="Connect Claude (Desktop & CLI)" href="/docs/integrations/claude-connect"}
Run AI-assisted test creation through your own Anthropic account.
:::
::::
