Email Testing for Selenium
Automate testing of OTPs, password resets, magic links, account verification emails, invitations, and transactional email workflows directly inside your test suite.
Team invite pending
To: selenium-user@test.trivumo.com
Selenium continues through the invite link
Invite URL
https://app.example.com/invite/team_...
Selenium assertions
ā invite email received ā link extracted from HTML ā browser landed on invite ā team membership verified
Why Trivumo + Selenium
Selenium handles the browser. Trivumo handles the email workflow.
Use Trivumo to make Selenium suites wait for inbox delivery, extract OTP codes and links, validate content, and run repeatable email tests in CI/CD.
Wait for incoming emails
Block the test until the exact message arrives, then assert on structured inbox data.
Verify email delivery
Prove the app sent the expected message to the right test inbox before continuing.
Extract OTP codes
Read verification codes from real email content without brittle regex scripts in every test.
Extract links
Pull password reset, magic link, invite, and verification URLs directly from the message.
Validate email content
Check subjects, recipients, rendered text, HTML, and template variables before users see them.
Test password resets
Complete forgot-password journeys from UI trigger to inbox, token link, and final login.
Test magic links
Open passwordless auth links inside the same automated browser session and assert sign-in.
Run in CI/CD
Use dedicated test inboxes in local development, preview deployments, staging, and pipelines.
Code Example
Email Testing in Selenium
Wait for the inbox event, read structured email data, and continue your browser test without brittle polling or manual inbox access.
Works for OTP verification, password resets, magic links, email verification, invitations, and notification workflows.
1TrivumoClient trivumo = new TrivumoClient(2 new TrivumoClientOptions(3 System.getenv("TRIVUMO_API_KEY"),4 "sandbox.trivumo.com"));56String email = trivumo.generateEmail();78driver.findElement(By.name("email")).sendKeys(email);910MessageFilters filters = new MessageFilters();11filters.setTo(email);1213MessageDetails message = trivumo.waitForMessageAfter(14 () -> driver.findElement(15 By.cssSelector("button[type='submit']")).click(),16 filters);1718String otp = message.getHtml().getCodes().get(0);1920driver.findElement(By.name("code")).sendKeys(otp);Popular Testing Workflows
Automate the email flows your users depend on
Use Trivumo with Selenium to make authentication, onboarding, and transactional emails part of your automated release checks.
OTP Verification
Capture one-time passwords from live emails and complete verification screens automatically.
Password Reset
Assert reset emails arrive, links are valid, and users can finish account recovery.
Email Verification
Validate signup and account activation emails across staging and preview environments.
Magic Link Login
Extract passwordless login links and verify authenticated sessions from browser tests.
Team Invitations
Check invite delivery, link generation, and first-login onboarding for new teammates.
Transactional Emails
Test receipts, notifications, lifecycle emails, and critical customer messaging.
Why Teams Choose Trivumo
Stop treating email as the flaky part of your test suite
Replace shared inboxes, local mail servers, and custom scripts with deterministic email testing APIs built for developer workflows.
Without Trivumo
With Trivumo
Works Everywhere
Run email tests anywhere your suite runs
Run email tests in local development, staging environments, preview deployments, and CI pipelines.
GitHub Actions
Run inbox assertions in pull request checks and release workflows.
GitLab CI
Add email verification to merge request and deployment pipelines.
Jenkins
Keep legacy and enterprise browser test suites email-aware.
Azure DevOps
Validate staging and preview emails before shipping to production.
CircleCI
Poll for real emails from parallel jobs without shared inbox collisions.
TeamCity
Make transactional email checks part of continuous delivery.
FAQ
Selenium email testing questions
Quick answers for teams adding automated inbox validation to browser tests, staging environments, and CI pipelines.
How do I test emails in Selenium?+
Trigger the email from your Selenium test, wait for the message with Trivumo, extract the OTP or link, and continue the same automated browser flow with normal Selenium assertions.
Can I extract OTP codes automatically?+
Yes. Trivumo returns structured email data and helper methods for extracting OTP codes from real messages, so tests do not need custom IMAP polling or one-off parsing scripts.
Can I test password reset emails?+
Yes. You can request a password reset, wait for the email, extract the reset link, open it in the browser, set a new password, and assert that login succeeds.
Does Trivumo work in CI/CD?+
Yes. Trivumo is designed for CI pipelines and parallel browser tests, with dedicated test inboxes that work in GitHub Actions, GitLab CI, Jenkins, Azure DevOps, CircleCI, TeamCity, and other systems.
Can I test staging environments?+
Yes. Use Trivumo inboxes in staging, preview deployments, and local development to verify that email content and links point to the correct environment.
Can I use custom domains?+
Yes. Trivumo can support testing workflows that use your own domains, so teams can validate realistic sender, recipient, and environment behavior.
Related Resources
Go deeper on email workflow testing
Explore practical testing patterns for the email flows that most often break release confidence.
Password Reset Testing
Learn how to automate password reset email workflows end to end.
OTP Verification Testing
Capture and assert one-time codes inside browser automation.
Email Verification Testing
Test signup confirmation and account activation emails reliably.
Magic Link Testing
Validate passwordless authentication links in real inboxes.
Transactional Email Testing
Verify receipts, notifications, invites, and lifecycle messages.
CI/CD Email Testing
Run email workflow tests in local, staging, preview, and CI pipelines.
Stop Manually Testing Emails
Add reliable email testing to your automated test suite in minutes.

