Forum Discussion

nebsta's avatar
nebsta
Contributor
9 years ago
Solved

XML Checkpoint from SQL Server Database

I am looking to perform a checkpoint verification against XML that I have extracted from a SQL Server database. I have created a JScript function to extract the data from the database and have created an XML object in the stores to save the baseline copy, however, I am unsure how to pass the XML into the checkpoint. Can I just save the data into a project variable and use this for the checkpoint?

 

I have been trying to save the SQL query into a file by passing the results of my database query function into the following:

 

function SaveXML(XMLFile)
{
var File = Storages.XML(XMLFile);

File.SaveAs("C:\\XMLTest.xml");
}

 

But this is just saving a blank XML document (I have already verified the output from the database to ensure that this is being passed across):

 

<?xml version = "1.0" encoding="ISO-8859-1"?>
<XMLStorage></XMLStorage>

 

Apolgoies if I am missing something obvious - I'm new to scripting!

  • Thanks for your help, I have managed to achevie this by saving the XML returned from the database using:

     

    aqFile.WriteToTextFile

    I am then doing a standard XML checkpoint within the keyword test.

4 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    can you pl explain what you are trying to achive..

    there could be simpler way to do  that.

    • nebsta's avatar
      nebsta
      Contributor

      My test is generating XML in a database - I want to run a checkpoint to verify that it matches a baseline copy of the XML (except for a few ID values that will change).