Forum Discussion

pjsoconnell's avatar
pjsoconnell
New Contributor
5 years ago

How To Export Multiple Existing Test Logs as MHT

Hi there!

I am trying to implement what I feel should be an easy solution.

 

(I will just pre-empt this by saying I know you can add an event to call Log.SaveResultsAs() to generate an MHT file of the currently running test OnStop etc, but I cannot modify events as it will greatly impact our test running time for CI if MHT files are generated after each test case (our cases are quite long). Of course its a trade-off we can make, but I wanted to see if I could do something else instead!)

 

Here as an example I have multiple logs for test runs that have already occurred. (I cant find an equivalent Log/slPack method to export pre-existing Logs to MHT, only currently running tests.)

If I right click on one of these, I have the option to Export Logs.

However, it seems that I cannot bulk export them - I only have an option to Remove if I select more than one. It is not that I want to export all of these different logs into one MHT file (that wouldn't make sense!), I just wish to be able to select multiple files, and have them all exported to their own MHT files at some desired location.

 

I have tried to do this programmatically as I mentioned, but I cannot find a means of exporting already existing logs.
Any advice for this seemingly simple task would be greatly appreciated!

Kind Regards,

PJ
 

  • Currently, programmatically, there is no way to do what you're asking.

     

    Likewise, the tool does not allow for multi-selecting logs and then exporting them.

     

    Now, as to using the Log.SaveResultsAs...  As you said, you don't want to impact your running time by doing so after every test case... but you don't need to do that.  In your MDS project, somewhere, after ALL the test cases have run, just add one final routine to do the Log.SaveResultsAs.  That will give you your one export at that time to save the log to MHT after all the test cases have run.

  • Hi pjsoconnell,

     

    I did not find a way to export all of them from the logs section together. I am using the same code snippet to do it. Following this thread if someone else has a solution 🙂

     

    Thanks

     

     

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Currently, programmatically, there is no way to do what you're asking.

       

      Likewise, the tool does not allow for multi-selecting logs and then exporting them.

       

      Now, as to using the Log.SaveResultsAs...  As you said, you don't want to impact your running time by doing so after every test case... but you don't need to do that.  In your MDS project, somewhere, after ALL the test cases have run, just add one final routine to do the Log.SaveResultsAs.  That will give you your one export at that time to save the log to MHT after all the test cases have run.