If your web or mobile application uses email one-time password (OTP) authentication, you can automate your login flow using mabl Mailbox and mabl credentials.
In an application that uses email one-time password (OTP), the user enters their username and password and requests a verification code. The application sends a verification code to the user's registered email address, and the user enters that verification on the application to finish logging in.
Setup
Before training a login flow that uses email OTP, take the following steps:
- Create a permanent mabl Mailbox address.
- Register a new user account in your application using the permanent email address
- Create mabl credentials using the permanent email address and password for the new account.
Creating mabl credentials
Launch the Trainer
After creating MFA credentials, you're ready to train a login that uses email OTP in the mabl Trainer! Make sure the test is associated with the MFA credentials you just created:
Associating a test with credentials
Train the email OTP login
In the mabl Trainer, take the following steps to train a login that requires email OTP:
- Log into the application using the mabl credentials:
app.defaults.username
andapp.defaults.password
. - When the application under test prompts you to check your email for a one-time code, open mabl Mailbox.
- In the "Select inbox" dropdown, select the permanent inbox associated with the email address.
- Click on the Open button.
- Confirm the email match criteria.
- When the page shows the email with the verification code, create a new variable: {x} > Create a variable.
- Set the variable source to "Element property"
- Click on the element that contains the verification code in the email.
Extracting the verification code
- Give the variable a name, such as
verification_code
, and save. - Enter the
verification_code
variable in the application. - Complete the login.