How to send report in TestComplete via email
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to send report in TestComplete via email
How to send report in TestComplete via email with complete log details
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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")
Justin Kim
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you everyone for help!
@bhavyaNaveen which reply helped you solve this?
Sonya Mihaljova
Community and Education Specialist
