Forum Discussion

hpdvs2's avatar
hpdvs2
Occasional Contributor
13 years ago

TestExecute to automatically export Result to unpacked XML.

I have TestExecute starting automatically from the command line via a Windows Task. 



***What I would like is to have it automatically export the results.  What parameters do I need?

OR, is there is a separate console command I can run that will allow me to export the results after completion.  (Of the latest result set, since it names it by time)





My preference is NOT the MSHTML packed file, but the export to a folder structure.  (I.E. contains the project.xml file among others)



I have code that strips out the results from the project XML, and exports to a database, but I always have to do this part manually.





Thanks.  (I have searched for this, but not been able to find it.)



Additional Info (Windows XP, TestExecute and TestComplete are both available.  Latest versions.)

3 Replies


  • Hello Dan,



    There is no way to export test results via the command line. We have a suggestion to implement this ability in our database, and your request has increased its rating. Thank you.



    As an alternative, you can do this from script (e.g. at the end of the test execution). Please see the Log.SaveResultsAs help topic for more information:



      Call Log.SaveResultsAs("C:\Results\Results.xml", lsXML)

  • hpdvs2's avatar
    hpdvs2
    Occasional Contributor
    so question:  Does this save the complete log up to that point? or just for that test?



    Also, if I call it again a few tests later, does it create the full log again, or just from the last time I called this method.



    The reason I ask, is because our automation is huge, and just producting the log takes upto 40 minutes at the end of the test.



    Also, is there a way to choose to export just the test, or the entire project log, depending on what I want?  I.e. some tests will export their mini logs right away, but at the end, where I have a test devoted to cleaning up the environment, I would have it save the full test log.



    thanks.

  • Hello Dan,



    The Log.SaveResultsAs method exports the whole log created by the moment of the method call. To reduce the size of the exported log, you can disable exporting Visualizer images:





      Call Log.SaveResultsAs("C:\Results\Results.xml", lsXML, False)





    If you need to export an individual test run's results, you can do it manually from the Project Explorer or Log page after the test run is over. Refer to the Exporting Test Results article for more information.



    Also, we have suggestions in our database to implement the ability to export specific project items and test items' logs, as well as to export only a new part of the log if the method was called twice, and your request has increased their ratings. Thank you.