Forum Discussion
Thanks LinoTadros , I see how it works now. Is there anyway I can only export the log for the current running test item? Say I have a test set that has 5 tests, and TC executes the tests one by one from top to bottom, when it finish executing the first test, then export the log file for the first test only, when it finish executing the second test, then export the log file for the second test only, I don't need the log for the first test again, I already have it.
Test Project:
Test 1 --> Export log for test 1
Test 2 --> Export log for test 2
Test 3 --> Export log for test 3
Test 4 --> Export log for test 4
Test 5 --> Export log for test 5
Unfortunately, there is no way using the current mehanism in TestComplete as of 14.1
The way I usually do it is to implement the OnLogError event and I can specifically log whatever I want to any file I want. I don't use the TestComplete Log file as it always runs at the END of the test. So even if your total test takes 6 hours to run, the MHT file does not get created or touched until the end (6 hours later) even if you use the SaveResultAs(...). So implementing the event is best as it happens immediately
Hope that helps
-Lino
- whuang5 years agoRegular Contributor
Hi LinoTadros can you please explain more how I can use the OnLogError event to export test log files? Isn't it only working when there is an error? Bacially what I need is export the test log file for the current test item if it passed. Below is the VBScript code I was using.
If (Log.WrnCount = 0 And Log.ErrCount = 0) Then Call Log.SaveResultsAs(FileName, lsMHT, True, lesCurrentTestItem) Else Exit Sub
But as I mentioned above, it exports the logs for the entire test project .
- whuang5 years agoRegular Contributor
Does anyone know is there any other way I can export single test log file for a test project that has multiple test items?
Related Content
- 8 years agoMulgraveTester
- 9 years agom_essaid
Recent Discussions
- 2 hours agoSubhraDas
- 8 hours agoJacobjacob44