gtf0utc
13 years agoNew Contributor
Do I understand the XPath Match assertions correctly?
Hi all,
I'm just hoping to confirm my interpretation of what is happening in this situation (it's one thing for me to suspect that it works this way, but since I'm using it for testing, I have to know...).
I have an XPath Match assertion like this (skipping namespaces):
and an expected result of:
What I believe is happening is that the star (*) is allowing a match on the text of any of the child elements of a:MessageText[1] (which is an array of <b:string>s). So, for instance, a result including
would return a true assertion if my ${DataSource#Message} was 'Message 1', 'Message 2', or 'Message 3'.
Can anyone please confirm that I'm correct in my understanding?
Many thanks!
gtf
I'm just hoping to confirm my interpretation of what is happening in this situation (it's one thing for me to suspect that it works this way, but since I'm using it for testing, I have to know...).
I have an XPath Match assertion like this (skipping namespaces):
//ns1:Response[1]/ns1:Result[1]/a:MessageText[1]/*/text()
and an expected result of:
${DataSource#Message}
What I believe is happening is that the star (*) is allowing a match on the text of any of the child elements of a:MessageText[1] (which is an array of <b:string>s). So, for instance, a result including
<a:MessageText xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<b:string>Message 1</b:string>
<b:string>Message 2</b:string>
<b:string>Message 3</b:string>
</a:MessageText>
would return a true assertion if my ${DataSource#Message} was 'Message 1', 'Message 2', or 'Message 3'.
Can anyone please confirm that I'm correct in my understanding?
Many thanks!
gtf