String Comparison in XML aseertor
I have to validate a set of currency fields which should not be available in the output message, can i simply select from Value assertion->String comparison assertion and give as below ?
String -> must not equal -> and in the "Fixed" drop down -> simple type as ‘XAG’, ‘XAU’, ‘XBA’, ‘XBB’, ‘XBC’, ‘XBD’, ‘XEU’, ‘XFU’, ‘XPD’, ‘XPT’, ‘XXX’ , so will the field validate all of the currencies or is it wrong input , i have attached screen shot
Answers
-
0
-
@benken_parasoft pls help
0 -
XPath is very powerful in itself. What you can do is create an XPath that matches what you want to make sure is NOT there and then have the "Occurrence Assertion" configured to match 0.
For example, take this XPath:
/root/items/item[text()="XAG" or text()="XAU" or text()="XBA"]
It would match 0 nodes on this (assertion passes):
<root> <items> <item>A</item> <item>B</item> <item>C</item> </items> </root>
It would match 1 node on this (assertion fails):
<root> <items> <item>A</item> <item>XAG</item> <item>C</item> </items> </root>
0