---
title: "Get sms code in a web test"
sidebarTitle: "Get sms code"
description: "Test an SMS verification flow on the web end to end: the step watches a test number, waits for the SMS, and extracts the code with AI."
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.

Test an SMS-based verification flow end to end. The step watches a test phone number, waits for the SMS to arrive, extracts the code with AI, and stores it in a variable you can type into the confirmation field.

## Parameters

| Parameter | Required | Description |
| ----------- | ---------- | ------------- |
| Phone number to receive code | Yes | The test phone number that should receive the SMS. |
| Variable | Yes | Name of the variable that receives the code. Default: `SmsCode`. |
| Ignore error on this step | No | The run continues with the next step if no code is found. Default: off. |

## Results and metrics

- **Variable**: the extracted code is stored in the variable, ready for a [Fill input](/tests/actions/web/input) step.
- **Timing**: start, end, and duration (in seconds). The duration includes waiting for the SMS to arrive.
- **Status**: failed if no SMS arrives or the AI finds no code in it.
- **AI usage**: the AI cost of the extraction is added to the run.

See [Email & SMS in tests](/tests/email-sms) for how test phone numbers are provisioned for your workspace.

## What's next?

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

    Type the extracted code into the confirmation field

</Card>
  <Card title="Email & SMS in tests" icon="message-sms" href="/tests/email-sms">

    How test mailboxes and phone numbers work

</Card>
</Columns>
