Writing log messages of test to the file
Hi, When TestComplete is being used, We try to write log messages which are come out of the "Log. Message()" or "Log.Error()" function to a text file in order to keep the log messages together as a log.txt. However, after creating a file, we try to use "Log.File()" function or "SaveResultsAs()" to write logs messages to this file, It just created the file, could not write anything. Is there any way to keep log messages that are written in the test script in the txt file in a given directory? as an example code; function creatingAndWritingLogMessagesToTheTxtFile(){ //create a file var filePath="C:\\.....";//Directory aqFile.Create(filePath); var logName="filePath"+".mth"; Log.SaveResultsAs(logName,lsMHT); } And in the functions how we can write the log messages to this created file that is created to keep log messages? as an example code; function testA(){ //....codes doing something Log. Messages("Test Successful"); //Here How can we use that method (If it is useful) to write this log to that text file?? }Solved1.3KViews0likes3CommentsHow 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 havealready occurred. (I cant find an equivalent Log/slPack method to export pre-existing Logs to MHT, only currently running tests.) If I right click onone 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, PJSolved1.5KViews0likes2CommentsTestcomplete 14 SaveResultsAs does not export summary.htm
Hi, I use Log.SaveResultsAs(FileName,LogFormat,ExportVisualizerImages,LogScope) for export Testresults in HTML after the testrun, call is : Log.SaveResultsAs(logpath, lsHTML, true, 0), logpath is defined in a variable. Testcomplete 14 has the summary report (summary.htm), when I call the export from Testcomplete ID or with commanline parameter, the file summary.htm will be exported, but when I use Log.SaveResultsAs the file summary.htm will be not exported. Is there something wrong with my call for Log. SaveResultsAs or does Log.SaveResultsAs not support the export of summary.htm? greentings Martin StrombergerSolved2.6KViews0likes4Comments