Forum Discussion
AlexKaras
13 years agoCommunity Hero
Hi,
You can load the XML checkpoint and modify it according to your needs.
Loading XML checkpoint will create a copy of the original and all modifications will be applied to this copy, leaving the original checkpoint in the Stores intact.
Something like this (excerpts from the real code):
objXMLCheckpoint := XML.GenericXmlCheckpoint; // get copy of the checkpoint
objXMLCheckpoint.Document := LoadXML(objXMLCheckpoint.Document, strMasterFilePath); // overwrite the copy by loading data from the expected master file
objXMLCheckpoint.Options.CompareInSubTreeMode := false;
objXMLCheckpoint.Options.IgnoreAttributes := true;
objXMLCheckpoint.Options.IgnoreNamespaceDeclarations := true;
objXMLCheckpoint.Options.IgnoreNodeOrder := true;
objXMLCheckpoint.Options.IgnorePrefixes := true;
DomDocument := LoadXML(GetXML4Obj(), strResultXML); // load actual results into another XML
// here you may modify objXMLCheckpoint and DomDocument XMLs as needed (add/remove nodes/attributes, etc.)
result := objXMLCheckpoint.Compare(DomDocument, true); // compare actual result with (customized) checkpoint
if (not result) then
...
You can load the XML checkpoint and modify it according to your needs.
Loading XML checkpoint will create a copy of the original and all modifications will be applied to this copy, leaving the original checkpoint in the Stores intact.
Something like this (excerpts from the real code):
objXMLCheckpoint := XML.GenericXmlCheckpoint; // get copy of the checkpoint
objXMLCheckpoint.Document := LoadXML(objXMLCheckpoint.Document, strMasterFilePath); // overwrite the copy by loading data from the expected master file
objXMLCheckpoint.Options.CompareInSubTreeMode := false;
objXMLCheckpoint.Options.IgnoreAttributes := true;
objXMLCheckpoint.Options.IgnoreNamespaceDeclarations := true;
objXMLCheckpoint.Options.IgnoreNodeOrder := true;
objXMLCheckpoint.Options.IgnorePrefixes := true;
DomDocument := LoadXML(GetXML4Obj(), strResultXML); // load actual results into another XML
// here you may modify objXMLCheckpoint and DomDocument XMLs as needed (add/remove nodes/attributes, etc.)
result := objXMLCheckpoint.Compare(DomDocument, true); // compare actual result with (customized) checkpoint
if (not result) then
...