Ask a Question

How to send report in TestComplete via email

SOLVED
bhavyaNaveen
Visitor

How to send report in TestComplete via email

How to send report in TestComplete via email with complete log details

3 REPLIES 3
hkim5
Staff

use the buildtin sendmail function alongside the log.saveresultas method in order to generate the complete log details, and attach it with the email you want to send. 

https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas...

modify the script below and include it as your final test item at the project level.

def test():
  Log.SaveResultsAs(Project.ConfigPath + "\\MHT_Files\\" + ProjectSuite.TestItems.Current.ProjectName + ".mht", lsMHT)
  SendMail("justin.kim@smartbear.com", "mail.smartbear.com", "Justin Kim", "justin.kim@smartbear.com", "Error in Test Run", "Please take a look at the attached results file", Project.ConfigPath + "\\MHT_Files\\" + ProjectSuite.TestItems.Current.ProjectName + ".mht")
  

 

Best,
Justin Kim
anupamchampati
Frequent Contributor

if you have report in any other formal live Excel or Text file in any location you can attach that as well.


function SendEmail()
{
var Filename1 = "{Path}\test1.xlsx";
var Filename2 = "{Path}\test2.xlsx";
var Filename3 = "{Path}\test3.txt";
var Filename4 = "{Path}\test4.xlsx";
var MessageBody = "Test";

SendMail("Receiver Email ID","mailrelay of company server","Sender Name","Sender email id","Subject",MessageBody,Filename1,Filename2,Filename3,Filename4);
}


sonya_m
SmartBear Alumni (Retired)

Thank you everyone for help!

 

@bhavyaNaveen which reply helped you solve this?


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: