- PooEdOccasional Visitor
Omg such a great idea give this man a medal :manvery-happy:
- tristaanogreEsteemed Contributor
Question: How do you have hundreds of different log files within the same project? Each test execution of a project creates one log file... so, at the end of the project, when it completes, you export that log file. Each time you run the project, you export the current log file.
If you have hundreds of projects in a project suite and want to execute the log for each one... again, the export happens within the project, not at the suite level (suites don't actually execute code, they just contain projects). So, if you run your project suite, each project that runs will export the desired log.
Guess I'm trying to understand what problem is attempting to be solved.
- jty0ytOccasional Visitor
Defects! With stop on error/stop on warning enabled and having frequent stoppages due to defects or automation issues with your scripts, the log files begin to pile up.
- tristaanogreEsteemed Contributor
So... turn off "stop on error/stop on warning" and create your automation to only stop when you want it to. Then, wrap your execution in try/catch/finally logic so that, when you DO run into an exception that causes you to have to halt the tests, you still export the log.
OR... you could implement "OnStopTest" event handler so that, when the test halts, you will execute log export.
- Vallalarasu_PFrequent Contributor
Are you looking for something like this, Which exists already.
Script to Save Logs:
Function SaveLogAsYouWish
FolderPath = “C:\Desktop\TC_Logs\Log\”
FileName = aqDateTime.Now
log.Message FileName
CurrenTime = aqConvert.DateTimeToFormatStr(FileName,”%d_%m_%Y_%H_%M_%S”)
Log.Message CurrenTime
LogFileName = FolderPath & CurrenTime & “_Log.mht”
Log.Message LogFileName
call Log.SaveResultsAs(LogFileName, lsMHT)
End FunctionThis function creates log and saves without over righting the existing log. Because the file name is created with respect to time stamp.
Added to it, if you keep this script in Events "OnStop of Test" . It resolves.
Keep this in different project, by sharing different FolderPath
FolderPath1: ProjectA\Logs
FolderPath2: ProjectB\Logs
Regards
Valla
https://vallatestcomplete.wordpress.com
Related Content
- 7 years ago
- 3 years ago
- 10 months ago
- 10 years ago