Hi Raj,
Then, I recommend that you add the OnLogError and OnStopTest events to your test and use the following code:
Dim IsErrorOccured
IsErrorOccured = False
Sub GeneralEvents_OnLogError(Sender, LogParams)
IsErrorOccured = True
End Sub
Sub GeneralEvents_OnStopTest(Sender)
'replace "TheLastTestItem" in the next line with the name of the last test item to run
If Project.TestItems.Current.Name = "TheLastTestItem" Or IsErrorOccured Then
Call Log.SaveResultsAs("File_Name", lsMHT)
Call SendMail("ClareJ@clarejeffersoncorp.com", "mail.johnsmithcorp.com", "John Smith", "JohnS@johnsmithcorp.com", "Notification", "Hello Clare, Your application is nice.", "File_Name.mht")
End If
End Sub