Ask a Question

Automate Email Log

muralidharan18
Occasional Contributor

Automate Email Log

Hi,

 

My requirement is to send my log through email automatically.  How can i configure automatic email for log? 

Can any one help me?

 

Thanks & Regards,

Muralidharan

5 REPLIES 5
tristaanogre
Community Hero

Re: Automate Email Log

Technically, the first three links that @dmiscannon are all part of the same basic answer. You need to use all that technology in one form or another to automate emailing the log.

What I've done in the past, however, is  at the end of the test run, export the log to a centralized location as a web page and then simply e-mailed the automation team that the tests have completed and they can go look them up. What this does is three thing:

1) Doesn't load up your server with having to send large files.

2) Doesn't require those receiving the logs to have to be required to have TestComplete installed to read the logs.

3) It creates an archive of the logs outside of TestComplete that can be easily referenced.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
muralidharan18
Occasional Contributor

Re: Automate Email Log

Hi,

 

https://support.smartbear.com/viewarticle/82075/?q=send%20log%20email#_ga=1.246979332.1075504268.146...

 

I implemented this method, while executing I'm getting this error "Transport failed to connect to the Server".

How to rectify it?

 

Thanks & Regards,

Muralidharan

tristaanogre
Community Hero

Re: Automate Email Log

That sounds like an authentication error.  Could you post the code that you  implemented? It's possible that there's a parameter set wrong. Be sure you have your e-mail username and password correct and that your mail server information is correct as well.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
muralidharan18
Occasional Contributor

Re: Automate Email Log

Hi 

 

This is my code.

 

function SendEmail(mFrom, mTo, mSubject, mBody, mAttach)
{
var i, schema, mConfig, mMessage;

try
{
schema = "http://schemas.microsoft.com/cdo/configuration/";
mConfig = Sys.OleObject("CDO.Configuration");
mConfig.Fields.Item(schema + "sendusing") = 2; // cdoSendUsingPort
mConfig.Fields.Item(schema + "smtpserver") = "smtp.gmail.com"; // SMTP server
mConfig.Fields.Item(schema + "smtpserverport") = 465; // Port number


// If you use Gmail --
// mConfig.Fields.Item(schema + "smtpserver") = "smtp.gmail.com";
// mConfig.Fields.Item(schema + "smtpserverport") = 465;

// If you use Outlook --
// mConfig.Fields.Item(schema + "smtpserver") = "smtp-mail.outlook.com";
// mConfig.Fields.Item(schema + "smtpserverport") = 25;

// If you use Office365 --
// mConfig.Fields.Item(schema + "smtpserver") = "smtp.office365.com";
// mConfig.Fields.Item(schema + "smtpserverport") = 587;

mConfig.Fields.Item(schema + "smtpauthenticate") = 1; // Authentication mechanism
mConfig.Fields.Item(schema + "smtpusessl") = true;
mConfig.Fields.Item(schema + "sendusername") = "My gmail ID"; // User name (if needed)
mConfig.Fields.Item(schema + "sendpassword") = "My password"; // User password (if needed)
mConfig.Fields.Update();

mMessage = Sys.OleObject("CDO.Message");
mMessage.Configuration = mConfig;
mMessage.From = mFrom;
mMessage.To = mTo;
mMessage.Subject = mSubject;
mMessage.HTMLBody = mBody;

aqString.ListSeparator = ",";
for(i = 0; i < aqString.GetListLength(mAttach); i++)
mMessage.AddAttachment(aqString.GetListItem(mAttach, i));
mMessage.Send();
}
catch (exception)
{
Log.Error("Email cannot be sent", exception.description);
return false;
}
Log.Message("Message to <" + mTo + "> was successfully sent");
return true;
}


function MainTest()
{
if (SendEmail("My Id", "Destination ID", "Subject", "Sample", "c:\\new\\Test.txt")){
Log.Checkpoint("Mail Sent Successfully");
}
else
{
Log.Error("Mail Not Sent");
}
}

 

Do I need to change anything else?

 

Thanks & Regards,

Muralidharan

cancel
Showing results for 
Search instead for 
Did you mean: