prouser
12 years agoContributor
Xpathassert-DateElement exists in all abbreviatedList nodes?
Hi All
I am trying validate via xpath assertion that "TBC_DATE" element exists in all abbreviatedList nodes
Soap UI Response::
<Results>
<ns2:abbreviatedList>
<ns2:id>4723278</ns2:id>
<ns2:TBC_DATE>2013-02-01</ns2:TBC_DATE>
<ns2:amount currency="USD">35.46</ns2:amount>
<ns2:cardLastFour>XXXXXXXXXXXX0316</ns2:cardLastFour>
</ns2:abbreviatedList>
...
...
...
...
...
...
...
...
<ns2:abbreviatedList>
<ns2:id>4723279</ns2:id>
<ns2:TBC_DATE>2013-02-01</ns2:TBC_DATE>
<ns2:amount currency="USD">37.46</ns2:amount>
<ns2:cardLastFour>XXXXXXXXXXXX0319</ns2:cardLastFour>
</ns2:abbreviatedList>
</Results>
Xpath Assertion
exists(//ns2:Row/ns2:TBC_DATE/text())
Correct me if Im wrong,
I am hoping that the above validation should return
true:: if TBC_DATE element exists in descendants of all <ns2:abbreviatedList> nodes
false::if TBC_DATE element is missing in even one of the descendants of <ns2:abbreviatedList> nodes
Currently, it is returning true even though TBC_DATE is missing in some of the <ns2:abbreviatedList> nodes
I am trying validate via xpath assertion that "TBC_DATE" element exists in all abbreviatedList nodes
Soap UI Response::
<Results>
<ns2:abbreviatedList>
<ns2:id>4723278</ns2:id>
<ns2:TBC_DATE>2013-02-01</ns2:TBC_DATE>
<ns2:amount currency="USD">35.46</ns2:amount>
<ns2:cardLastFour>XXXXXXXXXXXX0316</ns2:cardLastFour>
</ns2:abbreviatedList>
...
...
...
...
...
...
...
...
<ns2:abbreviatedList>
<ns2:id>4723279</ns2:id>
<ns2:TBC_DATE>2013-02-01</ns2:TBC_DATE>
<ns2:amount currency="USD">37.46</ns2:amount>
<ns2:cardLastFour>XXXXXXXXXXXX0319</ns2:cardLastFour>
</ns2:abbreviatedList>
</Results>
Xpath Assertion
exists(//ns2:Row/ns2:TBC_DATE/text())
Correct me if Im wrong,
I am hoping that the above validation should return
true:: if TBC_DATE element exists in descendants of all <ns2:abbreviatedList> nodes
false::if TBC_DATE element is missing in even one of the descendants of <ns2:abbreviatedList> nodes
Currently, it is returning true even though TBC_DATE is missing in some of the <ns2:abbreviatedList> nodes