Overview
The Check Email step retrieves email content sent during your test execution. Use it to verify email delivery, extract verification codes, test OTP flows, and validate that your application sends the right emails at the right time.When to Use Check Email
Use Check Email when you need to:- Test email verification flows: Verify that signup or login verification emails arrive correctly
- Extract OTP codes: Retrieve one-time passwords or verification codes from emails
- Validate email content: Check that confirmation emails, receipts, or notifications contain correct information
- Test password resets: Verify password reset emails and extract reset links
- Check transactional emails: Validate order confirmations, shipping notifications, or account updates
How It Works
Check Email retrieves emails sent to special test email addresses powered by Mailosaur. These addresses follow the pattern[email protected] and can receive real emails during test execution.
You specify an email “slug” (the part before @), and the step retrieves the most recent email sent to that address. The complete email content - subject, body, links, codes, attachments - is stored in a variable you can use in subsequent steps.
The step works with both static email slugs you define directly and dynamic email addresses generated by the Fill step’s Supatest Email feature.
Using the Check Email Step
When you add a Check Email step, you’ll configure:Specifying the Email Address
You can specify the email address using expressions that reference environment variables or variables from previous steps: Static Email Slug Enter an alphanumeric slug directly (liketestuser123). The step will check emails sent to [email protected].
Using Expressions
Use expressions to reference:
- Environment variables:
{{env.EMAIL_SLUG}}- Use values from your selected environment - Variables from previous steps:
{{vars.userEmail}}or{{vars['userEmail']}}- Reference email addresses generated earlier in your test
- Email slugs must be lowercase and alphanumeric only - no spaces, hyphens, underscores, or special characters
- If your environment variable or variable already includes the full email address (with domain), it will be used as-is. Otherwise, the domain will be automatically appended
- Use square bracket syntax
{{vars['variableName']}}for variable names with special characters
Accessing Email Content
The step automatically creates a variable (likesupatestMessage_0, supatestMessage_1) that stores the complete email. You can access:
- Subject: The email subject line
- Body: HTML and plain text versions
- Links: All links in the email
- Codes: OTP codes and verification numbers
- Sender: From address and name
- Attachments: Any attached files
Real-World Examples
Example 1: Dynamic Email with OTP (Recommended)
This approach generates a unique email address for each test run, ensuring perfect test isolation. Step 1: Generate and Use Random Mailosaur Email Add a Fill step for the email field:- Use expressions and select
{{random.mailosaurEmail()}} - Save that in a variable (userEmail)


[email protected] and stores it in the userEmail variable.
Step 2: Retrieve the Email
Add a Check Email step and use an expression to reference the email variable:
- Enter
{{vars.userEmail}}or{{vars['userEmail']}}in the email slug field - The step will automatically extract just the slug portion if the variable contains the full email address
- Toggle on “Use variable”
- Select your email variable (
userEmail) from the dropdown

supatestMessage_0.
Step 3: Extract and Use the OTP Code
Add a Fill step for the OTP input field and use an expression to extract the code:
- Enter the correct expression, e.g.
{{vars['supatestMessage_0']['html']['codes'][0]}}in the text field


Example 2: Static Email Address
Use this approach when you need a predetermined email address for testing. Step 1: Fill Email FieldExample 3: Extract Verification Link
Example 4: Verify Email Content
Understanding Email Response Format
Supatest uses Mailosaur for email testing. The email variable contains a structured JSON object with all email details:Common Expressions
Use these expressions in step fields (wrap in{{ }}):
Extract first link URL:
Best Practices
Choose the Right Approach
- Use dynamic emails (Supatest Email feature) for maximum test isolation and parallel execution
- Use static emails for simple, sequential testing scenarios
- Use environment variables (
{{env.EMAIL_SLUG}}) when slugs differ per environment - Use expressions (
{{vars.userEmail}}) to reference email addresses generated in previous steps
Email Slug Guidelines
- Always lowercase: Email systems are case-insensitive, use lowercase for consistency
- Alphanumeric only: No spaces, hyphens, underscores, or special characters
- Descriptive names: Use slugs that indicate purpose like
signupverifyorpasswordreset - Unique per purpose: Different test scenarios should use different slugs
Timing Considerations
- Email delivery typically takes 1-5 seconds
- Add a Wait for Element before checking if needed
- Consider network latency and email service processing time
- Don’t check too quickly after triggering the email
Variable Management
- Each Check Email creates a new auto-numbered variable
- Use meaningful names when referencing email variables in expressions
- Remember variable names for multi-email workflows
- Document which email each variable represents
Troubleshooting
Email Not Found
Symptom: Check Email step fails to find an email Solution:- Verify the email slug exactly matches what your app sends to
- Confirm emails go to
@uoz0hbri.mailosaur.netdomain - Wait longer for email delivery (add a Wait step)
- Check that your application actually sent the email
- If using dynamic email, verify the variable was captured correctly
Invalid Email Slug
Symptom: Error about invalid email slug format Solution:- Use lowercase letters and numbers only
- Remove spaces, hyphens, underscores, or special characters
- Don’t include the
@uoz0hbri.mailosaur.netdomain (just the slug) - Verify environment variables resolve to valid alphanumeric strings
Variable Dropdown Empty
Symptom: “Use variables” shows no options Solution:- Ensure you’ve used a Fill step with Supatest Email earlier in the test
- Verify the Fill step ran successfully and created a variable
- Check that the variable name matches exactly (case-sensitive)
- Make sure the Fill step comes before the Check Email step
- Remember:
vars.*variables are resolved at runtime, so they won’t be validated in the frontend - Use square bracket syntax
{{vars['variableName']}}if the variable name contains special characters
Expression Errors
Symptom: Can’t extract codes or links from email Solution:- Verify the email actually contains codes/links (check the email manually)
- Use correct array indexing:
codes[0]for first code - Check HTML vs text content (some emails only have one format)
- Inspect the email variable structure to confirm paths
Timing Issues
Symptom: Step runs before email arrives Solution:- Add Wait for Element after triggering the email
- Increase wait time if emails take longer to deliver
- Check email service status if persistent delays occur
- Verify network connectivity
Related Steps
- Fill - Generate Supatest Email addresses for dynamic email testing
- Navigate - Navigate to links extracted from emails
- Wait for Element - Wait before checking emails
- Extract Value - Extract values to use as email slugs

