konrad :
"I
created a solution that works for me. I have written a script which uses
the events OnLogError and OnStopTest. It stores an error flag on
OnLogError and writes the logs OnStopTest only if this flag is set." No need to set a flag in LogError event handler. Use Log.ErrCount in StopTest event handler.I found out different scenario where I need to save my log.
- Log is on Error,
- Last TestItem to be run (+1 Lexi)
- Delay since the last save > 5 minutes
I think the last one should not be removed. In our case, we are able to follow TestExecution logs directly in a browser as we save log result on a web server. Keep in mind Log.SaveResult is a stupid function as it save every single file from the beginning of the execution... When you run TestExecute for several hours, you are going to save the log several times and the execution time will become exponential... (especially if you save it when the test item failed...)
Guillaume.