Ask a Question

Able to send mail for log data through script but confused in path for file location.

Regular Contributor

Able to send mail for log data through script but confused in path for file location.

I am executing test items and in the last of queue Email Test cases is there to send reports.

but problem is in Sendmail() function we need to provide parameter for file location. so this function will get that file and will send to respecttive userID. 

My question is if I am providing file location details like "C:\Users\KO\Music\file1.mht" 

then will it overide the log data here whenever I will execute my test items. if not then how i will be able to send my log data after test item execution.

Hope you get my point.
Please guide.

Community Hero

I don't understand what you want to do. Are you asking me:

1) The file you send to the disk will be deleted after you perform SendMail()?
2) Do you always want to take only the latest log file to sendMail()?

For these cases i built a path test\date based name and export to this path and i send mail the exported log.

The exported log contains also timestamp.


testexecute.mht -> exported to \results\myApp\03-19-2020\myAPP03-19-2020-100005.mht


But as @Wamboo  i dunnot understand clearly what u want.



Un sourire et ça repart

Esteemed Contributor

@BenoitB is correct.... you best practice would be to make sure that your MHT file has a unique name each time it's created.  That will prevent over-writing/replacement.

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

adding on to all of the other comments, I'd suggest using aqDateTime to get a timestamp (when you are initally creating these mht files) or using something lke ProjectSuite.TestItems.Current.ProjectName to get the relevant unique name for each of your runs. 

Justin Kim
SmartBear Alumni (Retired)

Thank you! Great suggestions everyone!


@kaiiii please mark the most helpful reply a as solution. Thank you!Smiley Happy

Sonya Mihaljova
Community and Education Specialist

SmartBear Alumni (Retired)

@kaiiii please let us know if you found out how to solve this. This would really help people in the long runSmiley Happy Thank you.

Sonya Mihaljova
Community and Education Specialist

Showing results for 
Search instead for 
Did you mean: