FYI: I've got a workaround for this. and decided that having the wild-card fail for empty elements does have it's uses (e.g. test that the element is present and always has some data, but it never empty). So I'd still like this enhancement, but with an option in the assertion for whether to have the wildcard treat an empty element as a pass or fail (when the wildcard is the ONLY contents of the element).
But, since we have an easy workaround, this enhancement's not as important.
The workaround is simple: In this situation, just have your expected result reference the contents of the element under test itself. Unlike the wildcard, this will also pass when the tested element is present and empty.
For example, using my example in the original post, here's the expected result:
<SOMEOPTIONALINFO>${ResultAsXml#//SOMEOPTIONALINFO[1]}</SOMEOPTIONALINFO>
Related Content
- 13 years ago
- 3 years ago
- 7 years ago