Forum Discussion

JKelsey's avatar
JKelsey
Occasional Contributor
15 years ago

Xpath check all but one node?

Is it possible to do an Xpath assertion that ignores one of the xml nodes?

E.g., my PUT request looks like this
<Lease>
<Uri>something</Uri>
<VersionStamp>1</VersionStamp>
<Date>2011-03-14</Date>
etc.
</Lease>

My assertion is currently on //Lease[1]

But it fails because the VersionStamp in the response is different than what was in the request (and it is expected to be different). I know I can individually assert each of the nodes (Uri, Date, etc.) but it would be a lot quicker if I could have one assertion that checks //Lease[1] and ignores //Lease[1]/VersionStamp[1].

Is that possible?