Forum Discussion

LouisP's avatar
LouisP
New Contributor
6 years ago

Exporting Test Logs and Results to XML or JSON

Hi, I saw a few posts regarding a similar question that I had but they were either never resolved or really old. 

 

I was wondering if it was possible to Export the Tests logs and results of a test run into an XML/JSON file that could then be parsed. Currently, using the Log.SaveResultsAs("My\\Path\\", 0, 0), I get a folder containing a RootLogData.dat file with a weird structure containing multiple nodes and value that referenced to other weird XML files. 

 

Here is the structure of the folder at My\\Path\\ :

 

 

And here is the RootLogData.dat file :

 

 

I feel like this is the XML that Test Complete uses to display the logs and results. The problem, it's that it is not readable and cannot be used. I want to have a file that can be parsed.

 

Thank you.

  • Hi LouisP,

     

    TC allows exporting test results to an XML format:

     Log.SaveResultsAs("My\\Path\\Log.xml", lsXML);

    Is this what you were looking for?

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi LouisP,

     

    TC allows exporting test results to an XML format:

     Log.SaveResultsAs("My\\Path\\Log.xml", lsXML);

    Is this what you were looking for?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    There currently isn't an XML export that will do what you're asking.  There are folks who have managed to be able to parse the raw log files.  Someone may be able to help you with that.

    • LouisP's avatar
      LouisP
      New Contributor

      Thank you for your quick answer. By any chances, do you have a link to where these types of work have been posted? Thanks again

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Not off the top of my head, no.

         

        Alternatively... there are plenty of objects built into TestComplete that can create and write out to multiple file formats.  You can also instantiate MSXML2.DOMDocument and create your own XML file if you need to.  What many users have done with TestComplete, if there is a need for custom reporting, has been to utilize these features and objects to generate their own report.  I know that shankar_r has done something in the not so distant past.  I write stuff out to SQL within my own framework.  Basically, there are about as many solutions are there are people who need solutions.  Since you would most like need to write your own parsing code anyways, perhaps you can investigate building a Script Extension or similar functionality to generate your own custom output.