Forum Discussion
2 Replies
Sort By
- dhundleyRegular Contributor
i was able to work around this issue by
- creating a project level boolean variable
- setting the variable value to true in the OnStartTestCase event handler
- using If logic to check the value of the variable just inside the OnStopTestCase event handler
- setting the variable value to false on the first line inside the If logic
- performing the Log.SaveResultsAs logic at the very end of the If logic
The Log.SaveResultsAs is still triggering the OnStopTestCase event handler as soon as it is encountered but my boolean variable will prevent the second (and and all subsequent recursive) calls to all the code inside the event handler because it has been set to false when the second call is made. This still seems like a bug to me.
- rraghvaniChampion Level 3
The method Log.SaveResultsAs has a parameter called LogScope. If LogScope is set to 0, it causes a recursive call, but if you change it to either 1 (Export the project log) or 2 (Export the log of the current test item), then it should work.
Related Content
- 10 months ago
- 7 years ago