Get sms code in a smartphone test

Test an SMS verification flow on a device end to end: get the code sent by SMS and reuse it in the app.

The step watches a test phone number, waits for the SMS to arrive, and has the AI find the code in it. It stores the code in a variable, ready to type into the app's confirmation field with a Fill input step.

Parameters

ParameterRequiredDescription
Phone number to receive codeYesThe test phone number that should receive the SMS.
VariableYesName of the variable that receives the code. Default: SmsCode.
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 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 for how test phone numbers are provisioned for your workspace.

What's next?

Fill input

Type the extracted code into the confirmation field

Email & SMS in tests

How test mailboxes and phone numbers work

Last updated on