Forum Discussion
ReshmaSachdev
13 years agoContributor
Hello,
You can use xpath instead for each sub node that you want to assert.
You can use following:
//GetClientList/Client[./ClientName/text()=''Sherry"]/./ClientAddline1/text() to assert for Addline1
Here is a more straightforward example:
RESPONSE
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<a>
<b>
<c>abc</c>
<c>wvu</c>
<c>xyz</c>
<c>qpo</c>
</b>
<b>
<c>zyx</c>
<c>wvu</c>
<c>xxx</c>
<c>qpo</c>
</b>
<b>
<c>but_output_this</c>
<c>wvu</c>
<c>qpo</c>
<c>looking_for_this</c>
</b>
<b>
<c>axt</c>
<c>wvu</c>
<c>qpo</c>
<c>zxz</c>
</b>
</a>
</s:Body>
</s:Envelope>
XPATH EXPRESSION
//a/b[./c='looking_for_this']/./c[1]
XPATH RESULT
but_output_this
Hope it helps.
You can use xpath instead for each sub node that you want to assert.
You can use following:
//GetClientList/Client[./ClientName/text()=''Sherry"]/./ClientAddline1/text() to assert for Addline1
Here is a more straightforward example:
RESPONSE
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<a>
<b>
<c>abc</c>
<c>wvu</c>
<c>xyz</c>
<c>qpo</c>
</b>
<b>
<c>zyx</c>
<c>wvu</c>
<c>xxx</c>
<c>qpo</c>
</b>
<b>
<c>but_output_this</c>
<c>wvu</c>
<c>qpo</c>
<c>looking_for_this</c>
</b>
<b>
<c>axt</c>
<c>wvu</c>
<c>qpo</c>
<c>zxz</c>
</b>
</a>
</s:Body>
</s:Envelope>
XPATH EXPRESSION
//a/b[./c='looking_for_this']/./c[1]
XPATH RESULT
but_output_this
Hope it helps.