Email Testing

You can test key user journeys that involve email interactions using mabl Mailbox. For example, your journey can test registering a user account, receiving verification email, clicking a link to verify the email address, and asserting that the email has been verified.

Enterprise feature

This feature is available to customers on the Enterprise plan, as well as all mabl trials.

What is mabl Mailbox?

Mailbox is an email service that mabl offers to help you test emails sent by your application under test. When training a journey, you can generate a unique email address that the app can send emails to. You can then interact with and assert against all received emails using the mabl Trainer.

The Mailbox capabilities include:

  • An easy way for any user to create end-to-end tests that include email validation without the need for scripting or complex setups
  • Ability to follow links from emails in the same end-to-end test
  • Capturing screenshots of the email message and detecting visual changes over time
  • Ability to validate attachments and their metadata
  • Highly secure inbox that keeps your test emails safe

Furthermore, unlike traditional email testing approaches, email testing with mabl enables you to validate that there are no issues with your web application's email service provider. If there were such an issue, those emails will not reach your Mailbox and the journey run will fail. Traditional email testing approaches typically intercept the emails sent by the app before they reach the email server and thus cannot alert you about issues with your email server or service provider.

Use cases

Mailbox is intended to be used for workflows that take an email address as an input such as:

  • User account registration
  • Web form submission notifications (e.g. Contact us)
  • Sending reports, invoices, reminders, etc. to user emails
  • Verifying attachments

Mailbox restrictions

  • Your form validations and mail provider should support email addresses up to 64 characters long
  • Email address must be an input to the journey and generated by mabl (not user supplied)
  • Email total size must be under 10 MiB (e.g. with attachments)

Testing emails

Below is a step-by-step tutorial that shows how you can generate a Mailbox address, use it to fill out a web form, receive an email upon form submission, assert against the email to verify its contents, and follow links as part of the end-to-end user journey.

  1. Create or edit a journey using the mabl Trainer
  2. Create a new variable and assign the mabl generated email address to it.

For example, we'll assign the address to the variable email_1.

Creating a Mailbox email address

Creating a Mailbox email address

  1. Use the variable as an input to the email address field of a web form such as the one shown on the animation below.
Insert the Mailbox email address into a submission form

Insert the Mailbox email address into a submission form

Once you submit your form and send the email, the message will appear in the Mailbox email assertions menu.

  1. Click through the "Assertions > Email" menu to assert against a specific email. It may take a minute for the email to arrive from your email server. Use the refresh button on the mail screen to check for new mail.

  2. Click on the email of interest to open the assertion menu. You may assert against sender address and email subject.

Asserting against email properties

Asserting against email properties

  1. You can interact with the received mail and follow links as if it were a typical web page.

Click through the "... > Open Mailbox" menu to view your mail. This time click the "Open email" icon that appears when you hover over the email of choice.

Now simply interact with the rendered email as if it were any other webpage. For example, you can click on registration email links.

Open the rendered email and interact with it, including clicking through links.

Open the rendered email and interact with it, including clicking through links.

Verifying attachments

Maximum Attachment Size

Total email size must be less than 10 MiB.
Since this includes all email headers and metadata, the attachment limit will be under 10 MiB.

When viewing and interacting with the rendered email, you also have the ability to verify attachments to ensure that you're able to test every part of an email.

Simply click on the link to the attachment to download it. mabl will automatically download the attachment and let you assert on it normally, as you would with any other download.

The location of attachments within a mabl Mailbox rendered email.

The location of attachments within a mabl Mailbox rendered email.

If the attachment is a PDF, and your subscription (i.e. Enterprise) includes PDF support, mabl will ask if you would like to test the PDF. From here you can test your PDF as you would any other.

Attachment Expiration

Attachment links will expire after 1 hour. If you keep an email validation tab open during manual training for over an hour, the links will not resolve. Simply replay the trained journey to get refreshed links.

Exploring the Mailbox sandbox

Interested in learning more about mabl Mailbox? We recommend testing against the mabl sandbox app, which has a dedicated Mailbox section. Just add an email address, subject, and body to start trying it out.

mabl sandbox Mailbox example

mabl sandbox Mailbox example

Email Testing


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.