Ask a Question

Email notification for failed testcases in Testcomplete

balakumarm
New Contributor

Email notification for failed testcases in Testcomplete

Hi, 

 

I'm attempting to send email notifications to the client regarding the failed test cases, along with the corresponding error logs. Unfortunately, I haven't been able to find suitable scripts for this task. I experimented with a JavaScript function as shown below and incorporated it into the Event Logger, but it hasn't yielded the desired results. If anyone with experience in implementing email notification functionality could provide some guidance or solutions, I would greatly appreciate it.

 

function OnLogError(Sender, LogParams)
{
// Check if the error is related to a test case failure
if ( LogParams.MessageText = "An unexpected window has appeared.")
{ // Prepare email parameters
var recipient = "recipient@example.com";
var subject = "Test Case Failed!";
var body = "The following test case failed: " + LogParams.LogMessage;
// Send the email using Office 365 SMTP server settings
aqUtils.Email.Send("smtp.office365.com", 587, "your_office365_username", "your_office365_password", recipient, subject, body);
}
}

2 REPLIES 2
KB1
Champion Level 2
Champion Level 2

Hello Balakumarm,

 

I've been looking through the documentations  for you but I cannot find anything about aqUtils.Email.

aqUtils Object Methods | TestComplete Documentation (smartbear.com)

 

also maybe take a look at this: Sending Email From Scripts | TestComplete Documentation (smartbear.com)

rraghvani
Champion Level 3

cancel
Showing results for 
Search instead for 
Did you mean: