Save As Log.mht rename file name as a date. Then send out email.
I am beginner and only work with keyword cases have very basic understanding about scripts.
THINGS I NEED TO DO:
1. Save report as today's_date.mht
2. Automatically send out an email after report document created.
THINGS WHAT I'VE DONE:
1. Created 2 scripts for "save as" and it works
2. Created a script for email automation and it give an error.
THINGS WHERE I'M STUCK:
1. Here is my "save as script" and it works but can somebody please help me to be able to save it as 'todays date' everytime.
// Saving file
2. Here is my script for email automation (outgoing server is correct etc), but I get an error: screenshot
I'm trying to use our Outlook mail which is installed locally.
if (SendMail("firstname.lastname@example.org", "relay.ventureresource.local", "Roman Marchuk", "email@example.com",
"Notification", "Hello QA, Your website is beautiful.", "V:\\TestComplete\\Reports\\Report.mht"))
Log.Message("Mail was sent");
Log.Warning("Mail was not sent");
Can somebody please help me I've been going back and forward with this for like 2 weeks now 😞
You'll need to use
to get the string you need for the file name
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
I wrote this vb script for my log files "strPrefix" refers to a variable I have that prefixes a the file with Passed, error, timeout etc depending on a flag set in one of the general events.
It will create a TestExecuteLogs folder in root c:\ and a date stamped folder in there, in those folders each log will have a datetime stamp in the file name.
Sub SaveLog Dim CurDate, CurTime, strCurDate, strCurTime, strFolder, strFile, strPrefix, strLogPath strPrefix = Project.Variables.strLogPrefix strLogPath = ProjectSuite.Variables.strSuitePath 'get current date and time CurDate = aqDateTime.Today CurTime = aqDateTime.Time 'convert current date and time strCurDate = aqConvert.DateTimeToFormatStr(CurDate, "%Y%m%d") strCurTime = aqConvert.DateTimeToFormatStr(CurTime, "%H%M%S") strCurTime = Replace(strCurTime, ":","-") Log.SaveToDisk 'Log save breakpoint 'Save log out to mht package strFolder = "C:\TestExecuteLogs\" & strCurDate &"\" strFile = strPrefix & "Log" & "_" & strCurDate & "_" & strCurTime & ".mht" If aqFileSystem.Exists(strFolder) = True Then Call Log.SaveResultsAs(strFolder & strFile, lsMHT) End If If aqFileSystem.CreateFolder(strFolder) = 0 Then Call Log.SaveResultsAs(strFolder & strFile, lsMHT) End If End Sub