SoapUI Assertion - XQuery Match



XQuery uses an XQuery expression to select content from the target property. It compares the result of an XQuery expression to an expected value.

Step 1 − After clicking Add Assertion, select Assertion Category – Property Content.

Step 2 − Select Assertion Type – XQuery Match.

Step 3 − Click Add.

Xquery Assertion

Step 4 − Similar to XPath, click ‘Declare’ to declare the namespace automatically or enter it manually.

Following XQuery structure needs to be defined −

for $x in //ns1:<XPath>  
//It declares iteration and XPath is where similar nodes are present 
return {data ($x/ns1:<attribute>)} //it will return all values of the attribute 

Step 5 − Click Save.

Declare Query

Step 6 − Select from current tab will display all the values present currently in response.

Note − Since this WSDL is not enough to use XQuery assertion, kindly use a WSDL having more and same attributes in response XML.

soapui_assertions.htm
Advertisements