Groovy in SoapUI

You can use groovy scripting in SoapUI.

Groovy Assertions in SoapUI
Groovy Assertions in SoapUI
Configuring groovy assertions in SoapUI
Configuring groovy assertions in SoapUI

Example –  In below example, we have added 2 assertions. First assertion checks that response time is less than 1 second and second assertion checks that we have “Name” tags in the response.

import com.eviware.soapui.support.XmlHolder

assert messageExchange.timeTaken < 1000

def myData = new XmlHolder( messageExchange.responseContentAsXml )

assert myData[“//Name”] != null