Get email code in a web test
Wait for a verification email in a test mailbox and capture its code in a variable during a web test.
Use it to test a flow that sends a one-time code by email, such as a sign-up or a login, end to end. The AI finds the code in the email and stores it in a variable. A Fill input step then types it into the confirmation field.
Parameters
| Parameter | Required | Description |
|---|---|---|
| Email to receive code | Yes | The test mailbox address that should receive the email containing the code. |
| Variable | Yes | Name of the variable that receives the code. Default: MailCode. |
| 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 to be typed into a confirmation field by a later Fill input step.
- Timing: start, end, and duration (in seconds). The duration includes waiting for the email to arrive.
- Status: failed if no email 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 for how test mailboxes work.
What's next?
Last updated on