Matching XML
equalToXml
and matchesXPath
, which are described
in detail in this article.
equalToXml
equalToXml
match operator performs a semantic comparison of the input XML
against the expected XML. This has a number of advantages over a straight string
comparison:
equalToXml
will match the input to the expected XML if all elements
and attributes are present, have the same value and there are no additional
elements or attributes.
For instance, given the following configuration:
matchesXPath
/things/thing[@name = 'socks']
.