Forum Discussion

gurmeet_kaur's avatar
gurmeet_kaur
Occasional Contributor
13 years ago

Delete OR Override the XML checkpoint from the Stores|XML

Hi,



I have created the XML checkpoint at  runtime using vbscript.

Now, i want to delete the same and create a new one at runtime because everytime i need to compare different things.



I can not find a way to remove the XML, method available is "XML.CreateXML" but there is no method like removeXML OR deleteXML.

if delete / remove is not possible , so is there any way I can override the checkppoint everytime??



Thanks....:)

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    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

        ...