Testing for e-mails with Groovy

Sometimes, it can be convenient to use SoapUI to test whether an e-mail has been received, for example, testing for an order confirmation e-mail after calling a create order service. In this recipe, we will learn how to check whether an e-mail has been received using Groovy TestStep. To keep things simple, we'll assume that the e-mail will have some kind of a unique string in its subject, for example, an order ID. The example will use Gmail, but other e-mail accounts can be used (the connection and security details will vary).

Getting ready

If you haven't got a Gmail account, you can consider signing up for one, or possibly use another account if you'd prefer.

Note

Google Gmail strict security

Google has strict security ...

Get SoapUI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.