Script Assertion SoapUI

I found many nonsense codes, that apparently work for everyone else. But here is a simple one that works for me.
Just remember this line:
assert response.contains(“what you want to assert goes here”)

1. Use the “GET DATA” feature and point to the Body XPath.
XPath_Body_SoapUI


Now you have:

def response = context.expand( '${checkNumberPortability-V#Response#declare namespace SOAP-ENV=\'http://schemas.xmlsoap.org/soap/envelope/\'; //SOAP-ENV:Body[1]}' )

assert response.contains(“true”)


So that’s it… pointing ‘response’ to the body will search all child components.