Resolve email OTP in AI runs
This document explains how to register a MailSlurp inbox in Katalon True Platform so Run with AI can retrieve a one-time passcode (OTP) during a login step.
Overview​
When an application emails a verification code during login, the code is not available until the run requests it. Registering a MailSlurp inbox lets you write a step such as "Enter the OTP from payroll inbox." and have the runner retrieve the latest code during the run.
The code is read at run time and typed into the application. It is redacted from test data, results, logs, run history, and API or MCP responses.
The setup has two parts: register the inbox as a secret, then name it in the test step.
- A MailSlurp account, with an inbox and its API key. Katalon does not host or provision the mailbox.
- Permission to manage Secrets & Variables on the project.
- A cloud-hosted execution environment. Secrets are not supported on self-hosted environments.
Set up email OTP handling​
The inbox is stored as a secret, alongside the project's other secrets and variables.
- Go to Settings > Configurations > SECRETS & VARIABLES.
- Select Add secret / variable.
- Leave Type set to Secret, then select MailSlurp Inbox as the secret type.
- Enter the inbox details and select Add MailSlurp inbox.
- Inbox name: The name you will use in test steps, for example
payroll. Choose something you can write naturally in a sentence. - Inbox UUID: The MailSlurp inbox identifier, in the form
00000000-0000-0000-0000-000000000000 - API key: Your MailSlurp API key. It is write-only. Once saved it is never rendered back in the UI, an API response, or an MCP response.
- Email address: The inbox's address, for example
payroll@example.mailslurp.com
- Inbox name: The name you will use in test steps, for example
Secrets are saved at the project level.
Refer to this interactive walkthrough to see the complete setup:
Name the inbox in the test step​
-
In your test step, refer to the inbox by the exact Inbox name you registered. For example:
Enter the OTP from payroll inbox into the verification code field. -
Run the test with Run with AI. The runner retrieves a new code when it reaches the step.
Only messages that arrive after the step begins are eligible. A code left over from an earlier run cannot satisfy the step.
If a step asks for a verification code without naming a registered inbox, it will not work. The runner may type a placeholder value, and the step may appear to pass. Always use the inbox name exactly as registered.
Renaming or replacing an inbox breaks steps that use its old name. Update those steps when you make the change.
In the run report, the OTP step's actual result is shown as --. This is expected: the code is redacted.
Concurrency​
Two runs sharing one inbox can consume each other's codes, because each run takes the newest matching message. Give concurrent runs distinct inboxes and distinct test data, or serialize them.
What is not supported​
| Not supported | Use instead |
|---|---|
| SMS or phone-delivered codes | No alternative |
| TOTP or authenticator-app codes | No alternative |
| A Katalon-hosted or Katalon-provisioned inbox | Bring your own MailSlurp inbox |
| Account-level or cross-project inbox configuration | Register the inbox per project |
| CAPTCHA and other human-verification challenges | No alternative |
Troubleshooting​
| Symptom | Cause and fix |
|---|---|
The runner types a placeholder such as 00000 or 123456 | The step did not resolve to a registered inbox. Check that the step names the inbox exactly as it appears in Secrets & Variables. |
| The step fails after waiting | No eligible message arrived while the step was running. Confirm the application actually sent to the registered address, and that the inbox is the one the application targets. |
| The step worked yesterday and fails now | The inbox was renamed or replaced. Steps bind by name, so update every step that referenced the old name. |
| Codes are intermittently wrong under load | Concurrent runs are sharing one inbox. Give each run its own inbox, or serialize the runs. |