SilkTest Question 44: How to email test results using Microsoft Outlook?

My indolent QA Manager wants me to send him the result of execution functional test every night and I'm been sluggish don not want to create and send emails manually. Can I send email with attachment using Silk Test?

Everything is possible in SikTest world. I use "partner -resextract -r "C:\Program Files\Segue\SilkTest\Projects\Winrunner\TestCase.pln" to extract test report. Next I created code below and save it as qtp.vbs (note vbs extension) and run newly created file with the following command "wscript qtp.vbs".

Dim objOutlook
Dim objOutlookMsg
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = "manager@automated.software.testing.com"
objOutlookMsg.CC = "debug@automated.software.testing.com "
objOutlookMsg.BCC = ""
objOutlookMsg.Subject = "Nightly build verification completed"
objOutlookMsg.Body = "Dear SQA Manager, attached is the result of execution of my lame test"
objOutlookMsg.Attachments.Add "test report"
objOutlookMsg.Send

2 comments:

Brady said...

Just what I needed. Thanks. Note: The first line of code is missing the 'Dim' (ie, Dim objOutlook).

MB said...

Thanks. Updated.

SilkTest interview questions for QA Testers