Summary
The default behavior of tests can be extended by scripting facilities included in soapUI. Using Groovy or JavaScript, more control over the tests can be gained and hence, custom functionalities for your soapUI tests can be introduced. As the soapUI APIs are accessible through scripting, many useful methods can be used in your soapUI tests. In this chapter, we looked into the scripting possibilities of soapUI using the Groovy scripting language. First, we had a glance at the fundamentals of the Groovy scripting language. We discussed many reasons for using scripts in a soapUI project. The two important context-related variables—context and testRunner - have been introduced and explained using simple examples. We also looked into the ModelItems, the preliminary categorization of elements in a soapUI project. Finally, we went through examples of using scripts at various levels of a soapUI project.