Book Image

SoapUI Cookbook

By : Rupert Anderson
Book Image

SoapUI Cookbook

By: Rupert Anderson

Overview of this book

Table of Contents (19 chapters)
SoapUI Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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 requirements to access Gmail from what it calls "less secure apps" (those not using OAuth 2 or accessing via an SSL tunnel). For example, by running the script in this recipe, you will see the following error message:

javax.mail.AuthenticationFailedException...