Skip to content

Check email in a test

Many flows send an email that the test needs to read, such as a confirmation or verification message. A disposable public inbox service makes this possible. Mailinator, Guerrilla Mail and InboxBear all let you create random, unique addresses.

  1. Create a unique address. Choose a string in the Mailinator web interface. This is a one-time setup, and you reuse the address in later runs.

  2. Record the flow that sends the email, using the new address.

  3. Open the inbox in a new tab. In this URL, replace test with your address string:

    https://www.mailinator.com/v4/public/inboxes.jsp?to=test
  4. Resume the recorder. CloudQA pauses when you switch to a new tab, so select Resume.

  5. Check the email. Open the message, validate its content or select the link in it, then save the test case.

  6. Add a Goto URL step. Open Edit steps for the saved test and add a Goto URL step with the inbox URL, so the test opens the inbox on every run.

  7. Optional: select the link in the email. If the message body is inside an HTML iframe, delete the recorded click, add a click step, and enter the element’s CSS path from the Elements pane. For an iframe, the selector looks like this:

    iframe~~TagName[attributename^='partial attribute value']
  8. Save and run the test.

A CSS path for an element inside an email iframe