Flo
6 years agoContributor
XPath : How to assert numerical values
Let's say a web service returns this part of response
<result> <string>Good</string> <number>10.0</number> </result>
For any external reasons, sometimes the answer contains <number>10</number> instead.
I would like to assert the content of //result for both number values (with or without decimals). Is there a keyword/function to use in "Expected result" to achieve that ?
Radford Yes you understand it correctly. Contains assertion may be an idea. As you said it is not ideal solution and in my case I think it is better to have a single assertion for "//number" instead of "//result".