Forum Discussion

Dk_3108's avatar
Occasional Contributor
3 years ago

Capturing Test Case Name while generating mail

Hi ,
I have a scenario where failed test case name to be captured in the mail subject which gets generated when there is a test failure.


I have used "OnLogError event" to generate email when ever the test fail by using the below script as mentioned in Support document.

def Test():
  if SendMail("", "", "John Smith", "", "Notification", "Hello Clare, Your application is nice.", "C:\\File1.txt", "C:\\File2.txt"):
    Log.Message("Mail was sent")
    Log.Warning("Mail was not sent")


Is there any way to capture the name of the test case name in the mail that gets generated on test failure?