Forum Discussion
SmartBear_Suppo
Alumni
12 years agoHi,
We (SmartBear SoapUI Pro Support) do not support custom code solutions, please keep this in mind while posting in the pro forums.
You should be able to use the SubmitListener.afterSubmit event handler with the following code Jestha posted previously and the code I'm adding to it to get the status.
Regards,
Marcus
SmartBear Support
We (SmartBear SoapUI Pro Support) do not support custom code solutions, please keep this in mind while posting in the pro forums.
You should be able to use the SubmitListener.afterSubmit event handler with the following code Jestha posted previously and the code I'm adding to it to get the status.
def headers = submit.response.responseHeaders
def status = headers.get("#status#").get(0).split(" ")
def statusValue = status[1]
if (statusValue == 201)
{
def assertion = submit.request.addAssertion("XPath Match")
assertion.path = "declare namespace ns1='http://www.xyz.com/xyz/abc/v1/xyz';\n//ns1:parentnode[1]/ns1:status[1]/ns1:value[1]"
assertion.expectedContent = "true"
}
Regards,
Marcus
SmartBear Support