Forum Discussion

Avasur's avatar
14 years ago

Need Help in Xquery Assertion

Hi All,

I am new to soapui and new to the forum. Please excuse me if I am asking a similar question if it exists in this forum.

I am trying to give Xquery assertion to validate the specific nodes returned in the response. When I added the following Xquery assertion to the Request or to the Assertion Test Step, I get the message that the assertion ran with OK status(OK:took 0 ms). But when I change a value in the assertion the test case does not fail instead it still finishes with out the assertion test step being failed. It seems the Assertions are being validated against the response message. I am not sure how to correct this. Please help me understand what I am wrong and resolve this please?

Xquery Expression:

declare namespace ns1='http://tempuri.org/';
declare namespace i='http://www.w3.org/2001/XMLSchema-instance';
declare namespace a='http://schemas.datacontract.org/2008/06/cdb.secData.secData.Contracts';
declare namespace s='http://schemas.xmlsoap.org/soap/envelope/';

<GetDomainValuesResult>
{
for $x in //DomainValue
order by $x/Code
return <DescriptionEn>{data($x/DescriptionEn/string())}</DescriptionEn>
}
</GetDomainValuesResult>

Expected Result:

<GetDomainValuesResult>
<DescriptionEn>0.1</DescriptionEn>
<DescriptionEn>3.0</DescriptionEn>
<DescriptionEn>4.0</DescriptionEn>
<DescriptionEn>5.0</DescriptionEn>
<DescriptionEn>0.5</DescriptionEn>
<DescriptionEn>0.3</DescriptionEn>
<DescriptionEn>4.5</DescriptionEn>
<DescriptionEn>1.0</DescriptionEn>
<DescriptionEn>2.0</DescriptionEn>
<DescriptionEn>3.5</DescriptionEn>
</GetDomainValuesResult>
No RepliesBe the first to reply