Groovy scripting in soapUI
There are many reasons for using Groovy scripts in a soapUI project:
To dynamically generate Mock Responses when simulating web services
To add arbitrary functionality to TestCases using Groovy Script TestStep
To use as Setup/TearDown scripts to initialize, and cleanup TestSuites and TestCases
To use as Start/Stop scripts in initializing/cleaning up mock services
To dynamically generate TestRequests and assertions based on database contents
The OnRequest and AfterRequest scripts in Mock Services
To perform arbitrary functionality during property expansion
We have discussed some of the scripting possibilities during Chapter 6, Web Service Simulation with soapUI, where we looked into the usage of scripts in Mock Services. We will see the other widely used patterns associated with Groovy scripting and soapUI during this chapter.
The Groovy scripts inside soapUI have access to the following context-related variables:
context
testRunner
In addition to the previous context...