One of the challenges in building a good automated testing tool is to be able to compare documents correctly and find the differences that matter. It is pretty simple to set an ignore expression, or as SAP PIT calls it, an exemption.
An ignore expression is an XPath in the case of XML documents. It will then ignore any differences between the two documents found here. You will then be able to focus on the errors that really matter.
For a client project we got some differences that looked like the following. I have just simplified the document.
As seen there is a new Item field in line no 1 of the document. Then on line 3 there is a difference in the number of decimals. And Line no 4 has a real difference in the quantity.
In many cases a missing element is the same as a blank element. Before, we had just ignored /order/line/item, but that could lead to some big problems as it would not see that item has been changed on line 2.
The number of decimals can sometimes be difficult to control, and they may not be important. So we also have an option to handle it. We can specify how many decimals we want to compare with.
We then end up with the following ignore expressions.
/order/line/qty{%.2f};
/order/line/item{empty-missing}
We then end up with the following differences, as expected. Here we can see that item 2 is different and there is a difference in line 4 qty. If we had used the old approach we would just have ignored the two differences and not seen it as a problem.
This feature is available in the Figaf DevOps Suite.
It is something like this kind of rules that can make it easy or impossible to use an automated testing tool.
start a free trial of the Figaf DevOps Suite to try it out on your own system.