Overview

The Check Email step retrieves content from emails during test execution. It’s typically used in workflows after filling email fields with the Fill step - you enter an email address in a form, then check the email that was sent to that address. It supports both static email slugs and dynamic values from previous steps, making it ideal for testing email verification flows, OTP delivery, and automated messaging systems.

Form Fields

Field NameTypeRequiredDescription
Email Slugtext/dropdownYesEmail identifier slug, or selection from variables declared in previous steps
Use variables ToggletoggleNoUse variables from previous steps instead of manual entry
Variableauto-generatedAutoVariable name to store retrieved email content

Form Configuration

Email Slug Input Options

The form provides two input modes for specifying the email identifier:

Manual Email Slug Entry (Default)

  • Email Slug: Text input field for entering alphanumeric email identifier
  • Supports environment variables using {{VARIABLE_NAME}} syntax
  • Combined with Mailosaur domain: yourslug@uoz0hbri.mailosaur.net

Use Variables

  • Use variables Toggle: Enable to show dropdown of available variables that have been declared previously in the test case
  • Email Slug: Dropdown showing variables from previous steps
  • Most common use case: Use with Fill step’s Supatest Email feature

Also available when other previous steps have declared variables (Extract Value, Run JavaScript, API Request, etc.)

Variable Storage

  • Variable: Auto-generated variable name (e.g., supatestMessage_0, supatestMessage_1)
  • Automatically increments for multiple check email steps
  • Stores the complete email content for use in subsequent steps

Examples

Basic Email Check

  • Email Slug: verification123
  • Use variables Toggle: Disabled
  • Variable: supatestMessage_0 (auto-generated)

This will check for emails sent to: verification123@uoz0hbri.mailosaur.net

Using Environment Variables

  • Email Slug: {{TEST_EMAIL_SLUG}}
  • Use variables Toggle: Disabled
  • Variable: supatestMessage_1 (auto-generated)

Using Dynamic Email from Fill Step

  • Use variables Toggle: Enabled
  • Email Slug: testUserEmail (from Fill step with Supatest Email random data)
  • Variable: supatestMessage_2 (auto-generated)

Best Practices

Email Slug Naming

  • Use descriptive, alphanumeric slugs that identify the test purpose
  • Use lowercase letters following email conventions (e.g., signupverification, passwordreset)
  • Avoid special characters, spaces, or punctuation
  • Keep slugs unique within your test suite to avoid conflicts
  • For environment variables, ensure the variable value is lowercase

Integration Strategy

  • Dynamic Email Testing (Recommended): Use Fill step’s Supatest Email feature with Use variables Toggle for robust email testing workflows
  • Use Manual Entry for known, static email addresses in test scenarios
  • Use Environment Variables for configurable email slugs across environments

Dynamic Email Workflow Benefits:

  • Each test run uses a unique email address, preventing conflicts
  • Realistic testing of complete email flows (form submission → email delivery → content verification)
  • Variables automatically link Fill and Check Email steps together
  • Better test isolation and repeatability

Variable Management

  • Each Check Email step creates a unique variable automatically
  • Use the generated variable in subsequent steps to verify email content
  • Content includes subject, body, sender, and other email metadata

Test Flow Planning

  • Place Check Email steps after actions that trigger email sending
  • Allow sufficient time for email delivery before checking
  • Consider email processing delays in your test timing

Understanding Email Response

Supatest uses Mailosaur for email testing functionality. When the Check Email step retrieves an email, it returns a structured response containing various email properties that can be accessed in subsequent steps.

Email Response Format

{
  "id": "77061c9f-da47-4009-9f33-9715a3bbf00c",
  "received": "2019-08-06T17:44:07.197781+00:00",
  "type": "Email",
  "subject": "Email subject line",
  "from": [
    {
      "name": "Acme",
      "email": "noreply@example.com"
    }
  ],
  "to": [
    {
      "name": "Jane Doe",
      "email": "janedoe@abc1234.mailosaur.net"
    }
  ],
  "cc": [],
  "bcc": [],
  "html": {
    "links": [
      {
        "href": "https://example.com/signup",
        "text": "Sign Up Now"
      }
    ],
    "codes": [{ "value": "12345" }],
    "images": [],
    "body": "Lorem ipsum..."
  },
  "text": {
    "links": [
      {
        "href": "https://example.com/signup",
        "text": "https://example.com/signup"
      }
    ],
    "body": "Lorem ipsum..."
  },
  "attachments": [],
  "metadata": {
    "headers": [
      {
        "field": "MIME-Version",
        "value": "1.0"
      }
    ]
  },
  "server": "abcd1234"
}

Common Usage Patterns

Extracting Links:

supatestVars['supatestMessage_0'].html.links[0].href; // Gets the URL
supatestVars['supatestMessage_0'].html.links[0].text; // Gets the link text

Extracting Codes (OTP, verification codes):

supatestVars['supatestMessage_0'].html.codes[0].value; // Gets the verification code

For more advanced email testing scenarios, refer to the Mailosaur documentation which covers HTML content, attachments, images, and other email properties.

Email OTP Example 1: Dynamic Email

Use this approach when you want unique email addresses for each test run, ensuring better test isolation.

Step 1: Fill Email Field with Dynamic Email

  • Step Type: Fill
  • Locator: <picked from recorder or element picker>
  • Random Data Toggle: Enabled
  • Text to Fill: Supatest Email (from Contact category)
  • Variable Name: userEmail
  1. Toggle on ‘Generate random data’

Select ‘Supatest Email (for OTP)’

Assign this to a variable that you can refernce in the check email step

This generates a unique test email address and stores it in the userEmail variable.

Step 2: Add a Check Email step

  • Step Type: Check Email
  • Use variables Toggle: Enabled
  • Email Slug: mySignUpEmail (select from dropdown)
  • Variable: supatestMessage_0 (auto-generated)

Toggle on ‘Use variable’

Select the variable that you declared in fill step (mySignUpEmail) and save

This retrieves the verification email sent to the dynamically generated address.

Step 3: Extract and Use OTP Code in another Fill step

  • Step Type: Fill
  • Locator: <picked from recorder or element picker>
  • Use variables Toggle: Enabled
  • Text to Fill: Create expression using supatestMessage_0

Toggle on ‘Use variable’

Select the email variable (supatestMessage_0) and create an expression

Enter the expression to extract the OTP code, save the expression and then save the step

Expression example: supatestVars["supatestMessage_0"].html.codes[0].value

This extracts the OTP code from the email and enters it into the verification field.

Email OTP Example 2: Static Email

Use this approach when you want to use a predetermined email address for testing.

Step 1: Fill Email Field with Static Email

  • Step Type: Fill
  • Locator: <picked from recorder or element picker>
  • Text to Fill: testuser123@uoz0hbri.mailosaur.net

This uses a predefined Mailosaur email address for testing.

Step 2: Submit Form and Check Email

  • Step Type: Check Email
  • Email Slug: testuser123
  • Variable: supatestMessage_0 (auto-generated)

This retrieves the verification email sent to the static email address.

Step 3: Extract and Use OTP Code

  • Step Type: Fill
  • Locator: <picked from recorder or element picker>
  • Use variables Toggle: Enabled
  • Text to Fill: Create expression using supatestMessage_0

For this step, use the same approach that as the first example.This extracts the OTP code from the email and enters it into the verification field.

Common Issues

Email Not Found

  • Verify the email slug matches exactly what your application sends to
  • Check that emails are being sent to the correct Mailosaur domain (@uoz0hbri.mailosaur.net)
  • Ensure sufficient wait time for email delivery
  • If using dynamic email from Fill step, verify the variable was properly captured

Invalid Email Slug

  • Email slugs must contain only alphanumeric characters
  • Remove spaces, hyphens, underscores, or special characters
  • Use environment variables for dynamic or complex email patterns

Environment Variable Problems

  • Ensure environment variables are defined and accessible
  • Use correct {{VARIABLE_NAME}} syntax with matching case
  • Verify the resolved variable value is alphanumeric

Supatest Variables Issues

  • Use variables Toggle only appears when you have declared variables in previous steps
  • Ensure the capturing step executed successfully before the email check
  • Verify the variable resolves to a valid alphanumeric string

Timing and Delivery

  • Email delivery may take several seconds depending on the service
  • Add appropriate wait steps if emails are not immediately available
  • Check email service status if persistent delivery issues occur
  • Extract Value - For extracting email slugs to use in email checks
  • Check Text - For verifying specific content within retrieved emails
  • Fill - For entering email addresses that will receive test emails
  • Wait for Element - For waiting before checking emails