Forum Discussion
I have seen this . But there is a condtion we need to trigger the email if there are errors in the log.
What I would do is, in your OnLogError handler, set the value of a global project boolean variable to true if an error is logged. Then, at the end of the project, just add some if-then logic to a "clean up" routine that, if that flag is true, send the e-mail.
- tristaanogre5 years agoEsteemed Contributor
OK, before I go any further, 2 things:
1) It's probably a good idea that, for a different issue, to start a new thread. That will help other folks having the same issue to find your thread and either comment or read your solution.
2) I don't do this for a living so, expecting the document to explain the issue means you're expecting me to sit down and do a full analysis of what you're doing to determine "Hey, there's a problem here!" Best rule of thumb: Declare the problem in the OP and provide screenshots and documentation for evidence.
That said... you're code has
Log.SaveResultsAs(outFile, lsMHT, 2)
While the parameters after outfile are optional, I think you might want to actually expand to all 4 parameters so that the "2" at the end is properly indicating the scope. Change to
Log.SaveResultsAs(outFile, lsMHT, false, 2)
and see if that corrects.
- nisgupta5 years agoValued Contributor
Finally Support Team has resolved the issue in TestCOmplete 14.20. If we want to export the log of current TestITems in MHT format then we can use the following function
Log.SaveResultsAs(outfile, lsMHT, true, 2);
- nisgupta5 years agoValued Contributor
Thanks for the updates
Here is some more issues besides email.
I am runing 2 project Items. When those testItems throw error we have error events triggered which stop the current testItem and then move to the next item. We are also trying to export the MHT report for the current projectItem when the error appears. For e.g. When one project Item start running and if there is error then error onlog handler event is called. At the same we want to export the MHT report. and then it move to the next projectItem and if the error occurs then same process . if no error then no MHT report.
I have attached the whole process in pdf file.
Let me know if you need more information
Thanks
Nishchal
I have attached the screenshot in pdf. MHT report get mixed up.
- tristaanogre5 years agoEsteemed Contributor
Interesting process. Generally looks good...
...what are the issues? You haven't indicated.
- nisgupta5 years agoValued Contributor
Did you see the MHT report ? The last 2 page in pdf file. They are mixed up.
We have the projectItems
NBAPBUD
NBAJOBS
First the projectItem - NBAPBUD is run and it has errors. So on logerror event handler is called. in this onlogerror event handler we stop the NBAPBUD projectitem from running further. Then we are trying to export the MHT report to the hard disk . When we open the MHT report - it is missing the error information .
Now when the the next projectItem is run -NBAJOBS is run - it has errors and so on logerror event handler is called. So we stop the testItem from running further and exprt the MHT report to the hard disk. When we open the MHT report - it containhe report about NBAPBUD - which is previous projectItem and the NBAJOBS
My expected result is
When the first projectITem is Run - NBAPBUD - we should see the MHT report for NBAPBUD.
When the second projectItem is Run - NBAJOBS - we should see the MHT report for NBAJOBS.
Thanks
Nishchal
- nisgupta5 years agoValued Contributor
Sorry for causing inconvenience
The issue still remain the same.
Thanks
- tristaanogre5 years agoEsteemed Contributor
The log scope SHOULD handle it. If it's not, then it sounds like something you should message the SmartBear support staff. I seem to remember that someone else reported a similar issue and there may be a patch that you can apply.
- nisgupta5 years agoValued Contributor
According to the support team
I've tried reproducing the behavior on my side, and it looks like the SaveResultsAs function cannot export the current test item log. I contacted our developers to find out what they think about the situation - whether it's a bug or a known limitation.
Thanks
NG
- TanyaYatskovska5 years agoSmartBear Alumni (Retired)
Thanks for the update, nisgupta.
Please keep us informed.
Related Content
- 2 years agoricharc
Recent Discussions
- 14 hours agoAivanitskiy
- 17 hours agonastester