"Spasibo" - Thank you. I looked at the help files, and it does seem to provide some useful information. I also found a nice VB script (see below) that is pretty much exactly what I was looking for. A follow-up question: My test was recorded in the keyword driven format. How would I insert this script into it? Is there a way to convert it to a VB or a J script on a fly? I'd really hate to re-record my test as it's pretty complex, and took me a fair amount of time/tweaking to get it just right. Thanks again for all your help.
Sub EmailLogResults()
Dim tempFolder, xDoc, wrnC, errC
tempFolder = "C:\temp\tclog1\"
' Remove the old folder
Call aqFileSystem.DeleteFolder(tempFolder, True)
' Prepare a temporary folder
aqFileSystem.CreateFolder(tempFolder)
' Save results to an .xml file
Call Log.SaveResultsAs(tempFolder, IsXML, True)
' Create an XMLDocument
' Set xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0")
Set xDoc = Sys.OleObject("MSXML2.DOMDocument.3.0")
' Load the file
Call xDoc.load(tempFolder & "Description.tcLog")
' Check the load result
If xDoc.parseError.errorCode <> 0 Then
Log.Message "File load result: "& xDoc.parseError.errorCode, _
"Error code: " & xDoc.parseError.errorCode & Chr(13) & Chr(10) & _
"Description: " & xDoc.parseError.reason & Chr(13) & Chr(10) & _
"Line No: " & xDoc.parseError.line & Chr(13) & Chr(10) & _
"Column: " & xDoc.parseError.linepos & Chr(13) & Chr(10) & _
"Source text: " & xDoc.parseError.srcText
Exit Sub
End If
' Count warnings
wrnC = xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='warning count']/@value").text
' Count errors
errC = xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='error count']/@value").text
' Save results to an .mht file
Call Log.SaveResultsAs(tempFolder & "TestLogRun1.mht",2)
' Send email
If SendMail(
me@domain.com, "smtp.domain.local", "Overnight Test Run 1", "
from@domain.com", "Errors = " & errC & " Warnings = " & wrnC, "Link to log:
\\mycomputer\temp\tclog1\TestLogRun1.mht") Then
Log.Message "email was sent"
Else
Log.Warning "email was not sent"
End If
End Sub