Get email code in a smartphone test

Test an email verification flow on a device end to end: the step watches a test mailbox, waits for the email, and extracts the code with AI.

Test an email verification flow end to end. The step watches a test mailbox, waits for the email, extracts the code with AI, and stores it in a variable you can type into the app's confirmation field.

Parameters

ParameterRequiredDescription
Email to receive codeYesThe test mailbox address that should receive the email containing the code.
VariableYesName of the variable that receives the code. Default: MailCode.
Ignore error on this stepNoThe 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?

Fill input

Type the extracted code into the confirmation field

Get email link

Extract a confirmation link instead of a code

Last updated on