Absent Member.
Absent Member.
1472 views

HP QuickTest Professional - Result email notification

Jump to solution

Greetings, I would like to know if it is possible and how to send email notification for the results of the Tests. Would like to make scheduled batch files to run tests and send emails of results to a few recipients.

Thanks in advance.

 

------------------------------------------------------------------------------------------------------------------------------
PS. This thread has been moved from Quality Center Support and News Forum to Unified Functional Testing (formerly QTP) News and Support Forum - Forum Moderator

.-asd-.
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

Never mind, I've made a script that will send email and will look for newest Result folder and attach the .xml file into the message body.

 

Set MyEmail = CreateObject("CDO.Message")

MyEmail.Subject = "Result from HP QuickTest Professional"
MyEmail.From = "TP-mailer@"
MyEmail.To = "receipient@"

TextBody = "Greetings, please refer to the attachment for the result of the Test. "
vbcrif = "The 'result.xml' can be viewed with 'HP Run Results Viewer' application for better readability with chart"
burger = ". "
MyEmail.TextBody = TextBody & vbcrif & burger

'#Section below configures the script to look for last result folder directory and retrieve the results.xml as attachment.
Dim objFSO
Dim fix
Dim str
Dim intt
Dim path
fix = "C:\TestScripts\QuickTest\"
str = "Res"
intt = 1
'#Create file object and loop
Set objFSO = CreateObject("Scripting.FileSystemObject")
Do Until intt = 1000
If objFSO.FolderExists(fix & str & intt) Then
    'MsgBox " "&fix & str & intt     '#unused testing validator
    intt = intt + 1
Else
    'MsgBox "The folder doesn't exists!" '#unused testing validator
    intt = intt -1
    path = fix & str & intt & "\Report\Results.xml"
       'MsgBox " "&path            '#unused testing validator
    Exit Do
End If
Loop

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.

MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'SMTP Server
MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IPhere"

'SMTP Port
MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'#SMTP Auth (For Windows Auth set this to 2)    #not needed now
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
'Username
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usename"
'Password
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "meh"

MyEmail.Configuration.Fields.Update

'==End remote SMTP server configuration section==

MyEmail.Send
set MyEmail=nothing

 

.-asd-.

View solution in original post

0 Likes
5 Replies
Commander
Commander

Hi

 

If you are executing from ALM/QC then on the Automation tab in the Test Set you have some options for email notification for executed tests in the TestSet

 

Thanks

Martin

0 Likes
Absent Member.. Absent Member..
Absent Member..
That notification does not include the actual results file from QTP. It only states the test was run and the status.
0 Likes
Absent Member.
Absent Member.

Thanks for the replies, I have tried the solutions given but to no avail, as my knowledge of coding is rather limited.

Still looking for a solution.

.-asd-.
0 Likes
Absent Member.
Absent Member.

Never mind, I've made a script that will send email and will look for newest Result folder and attach the .xml file into the message body.

 

Set MyEmail = CreateObject("CDO.Message")

MyEmail.Subject = "Result from HP QuickTest Professional"
MyEmail.From = "TP-mailer@"
MyEmail.To = "receipient@"

TextBody = "Greetings, please refer to the attachment for the result of the Test. "
vbcrif = "The 'result.xml' can be viewed with 'HP Run Results Viewer' application for better readability with chart"
burger = ". "
MyEmail.TextBody = TextBody & vbcrif & burger

'#Section below configures the script to look for last result folder directory and retrieve the results.xml as attachment.
Dim objFSO
Dim fix
Dim str
Dim intt
Dim path
fix = "C:\TestScripts\QuickTest\"
str = "Res"
intt = 1
'#Create file object and loop
Set objFSO = CreateObject("Scripting.FileSystemObject")
Do Until intt = 1000
If objFSO.FolderExists(fix & str & intt) Then
    'MsgBox " "&fix & str & intt     '#unused testing validator
    intt = intt + 1
Else
    'MsgBox "The folder doesn't exists!" '#unused testing validator
    intt = intt -1
    path = fix & str & intt & "\Report\Results.xml"
       'MsgBox " "&path            '#unused testing validator
    Exit Do
End If
Loop

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.

MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'SMTP Server
MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IPhere"

'SMTP Port
MyEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'#SMTP Auth (For Windows Auth set this to 2)    #not needed now
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
'Username
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usename"
'Password
'MyEmail.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "meh"

MyEmail.Configuration.Fields.Update

'==End remote SMTP server configuration section==

MyEmail.Send
set MyEmail=nothing

 

.-asd-.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.