Forum Discussion
nayerehgh
12 years agoNew Contributor
I have the same problem, please help me
the XML response of service is like below:
I use Xquery Match for assertion . and XQuery Expression has value
and code in the Expected Result
but i get the below error and assertion failed:
can anyone help me? please help me
thank you
the XML response of service is like below:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:transferSummaryResponse xmlns:ns2="http://service.y.modern.t.com/">
<return>
<currency>IRR</currency>
<transactions>
<count>1</count>
<totalAmount>10</totalAmount>
<transactionStatus>READY_FOR_PROCESS</transactionStatus>
</transactions>
<transactions>
<count>1</count>
<totalAmount>20</totalAmount>
<transactionStatus>SUSPENDED</transactionStatus>
</transactions>
</return>
</ns2:reportAchTransferSummaryResponse>
</S:Body>
</S:Envelope>
I use Xquery Match for assertion . and XQuery Expression has value
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns2='http://service.y.modern.t.com/';
<Row>
{
for $z in //ns2:TransferSummaryResponse/return/transactions
return data($z/ns2:totalAmount/text())
}
</Row>
and code in the Expected Result
<Row>10 20</Row>
but i get the below error and assertion failed:
XQuery Match Assertion failed for path [declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; declare namespace ns2='http://service.y.modern.t.com/'; { for $z in //ns2:TransferSummaryResponse/return/transactions return data($z/ns2:totalAmount/text()) } ] : Exception:org.custommonkey.xmlunit.Diff [different] Expected presence of child nodes to be 'true' but was 'false' - comparing at /Row[1] to at /Row[1]
can anyone help me? please help me
thank you