Videos
Check out our tutorial video series.
Use programmable email accounts in UI Path integration testing for MFA/2FA verification
UiPath is a leading robotic process automation (RPA) platform used to automate repetitive business and testing workflows. UiPath Studio allows testers and QA engineers to build automated UI and API driven tests using visual workflows and code activities. While UiPath is commonly used for enterprise process automation, it is also very effective for end to end testing of web applications that depend on email based verification.
Modern web applications often rely on email based one time passwords to verify users during sign up, login, and sensitive account actions. Testing these flows reliably is difficult because OTP codes are generated dynamically and sent to real inboxes. Manual testing is slow, brittle, and does not scale. This is where UiPath automation and programmatic email testing become essential.
NOTE: all source code is available on GitHub
In this tutorial and the accompanying youtube series we will demonstrate how to use MailSlurp's free disposable email accounts to create real, unique email accounts on demand and automate the testing of a real web application's OTP verification flow.

An OTP, or one time password, is a short lived security code sent to a user by email or SMS to confirm identity or ownership of an account. Email OTP verification is widely used to prevent fraud, reduce fake sign ups, and secure password resets. Because these codes expire quickly and are unique per request, they are notoriously hard to test using traditional automation tools alone.
Automated testing of email OTP flows ensures that user sign up and authentication journeys work correctly under real conditions. By capturing verification emails, extracting OTP codes, and submitting them back into the application automatically, teams can validate critical security and onboarding flows with confidence. This approach improves test coverage, reduces regressions, and enables fully automated CI friendly testing of email verification logic using UiPath.
Assuming you already have UiPath Studio installed on your Windows PC, we can use the program to define a series of steps and automations that will:
Our end workflow will look something like this:

First you need a free MailSlurp account. You can create a free account and obtain an API Key. We will use this in the next steps.
Start by opening the MailSlurp playground application in Chrome using UiPath browser automation. This demo app simulates a real user sign-up and email verification flow.
In UiPath Studio, create a new Process and add a Use Application/Browser activity. Select Chrome as the browser and set the URL to:
Once the page loads, add a Check App State or Element Exists activity to confirm the application is ready. Target a stable element such as the page header or the sign-up button to avoid flaky tests.
Next, create a disposable email inbox using the MailSlurp API. This inbox will receive the OTP verification email during sign-up.
Add an HTTP Request activity with the following configuration:
Store the response body in a string variable. Use regular expressions to extract the inbox ID and email address from the JSON response.
Save these values to variables named and .
With a real email address available, automate the sign-up flow in the browser.
Using Chrome automation in UiPath:
into the username or email fieldAfter submission, wait for the OTP verification screen to appear. This confirms that the application has sent a verification email.
Now wait for the verification email and extract the one time password.
Add an HTTP Request activity configured as follows:
Store the response in a string variable. Extract the email body and then extract the OTP code using a regular expression.
Use the following regex to find a 6 digit OTP code in the email body:
Store the matched value in a variable called .
Return to the Chrome browser session where the OTP form is displayed.
into the verification input fieldOnce verification succeeds, sign in again using the same email address and password. Finally, assert that the user account is verified by checking for a logged-in dashboard element, a verified account label, or another authenticated-only UI element.
This final assertion confirms that the full email OTP verification flow works end to end using UiPath and MailSlurp.
To explore MailSlurp and UiPath:
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.
