Testing email and SMS with Robot Framework in Python
Use Robot Framework to create throwaway mailboxes and send and receive email and SMS.
Recommended setup
- Install Robot Framework and your Python dependencies.
- Configure the MailSlurp API key as an environment variable.
- Use helper keywords to create inboxes and wait for messages.
- Isolate test data by creating new inboxes per scenario or test run.
Common test flow
- Create inbox
- Trigger app action that sends email/SMS
- Wait for message with bounded timeout
- Assert message content and links/codes
- Preview the delivered email when layout, dark mode, or client-specific rendering matters
- Cleanup resources where needed
Email previews in Robot Framework workflows
After a Robot Framework test captures the expected email, use MailSlurp device renders when the delivered message also needs visual proof. This is useful for sign-up, password reset, OTP, billing, and notification flows where the test should prove both content and layout.
Start with the inbox assertion in this integration, then add device renders to review Gmail, Outlook, mobile, desktop, light mode, and dark mode output from the received message.