Has any one access the TestLog contents through the script ?
Goal is After we finished runing the projects which contain 4-5 projectItems and check if each projectItem has errors we want to export the error log and then send it to team about the error of each projectItem .
I have looked at the documenation below.
But this allow only project log. We are looking to access the Testlog for each project Items and check if there is error in each projectItem.
Has any one done this ? It would be great if any one can shared the code /sample ?
The best way to do this on a TestItem level is to implement the "OnLogError" event and in that event use the Builtin.SendMail() funtion in order for you to send an email as soon as an error occurs in a TestItem without even waiting for the entire test to complete.
Thanks for the updates
This is what I am doing. invoking onlogerror when there is error in testItem. Then in onStpTest Events trigger the email . But which testlog we have to attach ?
in the event itself, you can figure out which TestItem caused the event to happen
Thanks for the updates . Yes we can use Log.Message(Project.TestItems.Current.Name);
to retrive the current TestItem. But how can we get the Test log for this current TestItem ?