---
title: "Extract value in a web test"
sidebarTitle: "Extract value"
description: "Capture data from the page into a variable: an order number to search for, a price to compare, a generated ID to type into another form."
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

Capture data from the page for later use: an order number to search for, a price to compare, a generated ID to type into another form. The step reads the element's text (or its value, for form fields) and stores it in a variable.

## Parameters

| Parameter | Required | Description |
| ----------- | ---------- | ------------- |
| Target element | Yes, unless a manual selector is set | Natural-language description of the element to read. |
| Manual selector | No | XPath or CSS selector, used when AI is disabled or as the saved selector. |
| Variable | Yes | Name of the variable that receives the extracted value. Default: `Extracted`. |
| AI usage | No | `inherit` (default, follows the test strategy), `smart`, or `always`. |
| Ignore error on this step | No | The run continues with the next step if this one fails. Default: off. |

## Results and metrics

- **Variable**: the element's text content (or its value, for form fields) is stored in the variable and available to every later step. Insert it anywhere a field supports variables.
- **Timing**: start, end, and duration (in seconds) recorded in the step result.
- **Status**: success, warning, or failed, with the error message on failure.
- **Screenshot**: captured after the step runs.
- **AI usage**: if the AI located the element, the healed selector is saved on the test and the AI cost is added to the run.

See [Variables](/tests/variables) for how extracted values can be reused across steps.

## What's next?

<Columns cols={2}>
  <Card title="Fill input" icon="keyboard" href="/tests/actions/web/input">

    Type the extracted value somewhere else

</Card>
  <Card title="Verify with AI" icon="sparkles" href="/tests/actions/web/aivisualassert">

    Compare values on screen without extracting them

</Card>
</Columns>
