How To Export Multiple Existing Test Logs as MHT
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!
Solved! Go to Solution.
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 🙂
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.
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider