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

Exporting custom reports using Groovy


Another option to create reports is to use a Groovy TestStep. Consider these situations:

  • You need to include extra information that is not available via one of the standard reports, for example, by accessing test framework objects or other test data.

  • You would like to produce a custom report format, for example, HTML or PDF.

  • You would like to use the report later in TestCase; for example, use the Email TestStep (see the Sending e-mails with the Email TestStep plugin recipe of Chapter 10, Using Plugins) to e-mail the results somewhere.

In this recipe, we'll see how to extract test results from the SoapUI framework classes and export the data to a custom XML report file using Groovy.

Getting ready

The SOAPDBMock-Reporting-soapui-project.xml project from the chapter 6 samples will be used to illustrate this recipe. You can find the Groovy script under the TearDown Script tab on GetInvoiceTestSuite (the file creation is commented out to save you from any path...