How to send QTP test results to an email...(with out using
Quality Center)?
Answers were Sorted based on User's Feedback
Answer / raj
Try this function
Function SendMail(SendTo, Subject, Body, Attachment)
Set ol=CreateObject("Outlook.Application")
Set Mail=ol.CreateItem(0)
Mail.to=SendTo
Mail.Subject=Subject
Mail.Body=Body
If (Attachment <> "") Then
Mail.Attachments.Add(Attachment)
End If
Mail.Send
ol.Quit
Set Mail = Nothing
Set ol = Nothing
End Function
Is This Answer Correct ? | 24 Yes | 3 No |
Answer / murali krishna
hi,
QTP will prepare the results in xml file format... if we
want to send the result...to mail.. By attaching the
respective file we can send it... if we want to send the
runtime data table... we can also attach it...
quality_muralikrishna@yahoo.com
Is This Answer Correct ? | 11 Yes | 6 No |
Answer / bharath
Good framework should automatically send the test results to
all the stakeholders, once the test is complete.
Best approach would be using CDO object, it is not required
to install MS Outlook on the PC where test is getting
executed. Attaching the link.
http://bharath-marrivada.blogspot.com/2010/02/how-to-send-email-with-attachments.html
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sreelaxmi
Save the test results in HTML format.
Navigation: FIle -> Export to HTML.
U will get the results in HTML format which is very much
understandable. U can mail this as an attachment.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / allan
''' use Raj's code above (#5) modifying this line
If (Attachment <> "") Then
Mail.Attachments.Add(Attachment)
End If
'''
set listattach = wildFileList(".*4.*jpg")
for each n in listattach
Mail.Attachments.Add(n)
next 'n
Function wildFileList(regx) ', fext)
'step 1 string list of filenames
Dim fso, tmp, tmp1, folder, File, regEx, Match, Matches, n,
fext
fext = right(regx,3)
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.getfolder(".")
For Each File in folder.Files
If fso.GetExtensionName(File)= fext Then 'regx & fext
tmp = File & vbcrlf & tmp 'regx & fext & vbcrlf & tmp
End If
Next
'step 2 exec regex on raw string
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = regx ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(tmp) ' Execute search.
set wildFileList = Matches
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / a
¿forgot how to attach?
dim sScreenshotPath
sScreenshotPath = "c:\somepath\" ' with trailing slash
Desktop.CaptureBitmap sScreenshotPath & "Err_" &
Environment( "TestName") & "_" & sTimestamp & ".png"
Function sTimeStamp()
sTimestamp = Right( "0" & Month( Now ), 2 ) & Right( "0" &
Day( Now ), 2 ) & Right( "0" & Hour( Now ), 2 ) & Right( "0"
& Minute( Now ), 2 ) & Right( "0" & Second( Now ), 2 )
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / lakshman
In above, mentioned only attachment not how to save result
and sent it as an attachment .
Can you please explain with script clearly
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / freak
Function SendMailOutlook(strMailto, Subject, Message,
strMailfrom)
'Create an Outlook object
Dim Outlook 'As New Outlook.Application
Set Outlook = CreateObject("Outlook.Application")
'Create e new message
Dim Message 'As Outlook.MailItem
Set Message = Outlook.CreateItem(olMailItem)
With Message
'You can display the message To debug And see state
'.Display
.Subject = Subject
.Body = Message
'Set destination email address
.Recipients.Add (strMailto)
'Set sender address If specified.
Const olOriginator = 0
IfLen(strMailfrom) > 0 Then .Recipients.Add
(strMailfrom).Type = olOriginator
'Send the message
.Send
End With
End Function
Is This Answer Correct ? | 7 Yes | 10 No |
Answer / issac
ANKITHA why dont u find some other job.and stop pestering
Is This Answer Correct ? | 5 Yes | 10 No |
How to test the login page in different ways in automation testing and i need code?
how u conduct GUI testing and PERFORMANCE testing on MS- WORD? and What r the GUI Test Cases and performance Test Cases?
3 Answers Accenture, Civil Service, ICICI, Jintek, Satyam, Singularity, Syntel, TCS, Wipro,
can some one help me how to compare the values from one sheet to values in another sheet? suposse i have a feild called Temp in action1 and i also have temp in action2. i want to compare the values of those two actions sheets data table? how can i do it using descriptive programming?
Differentiate the type of test cases which can be automated and which cannot be automated?
Does QTP have any limitations?Can it work with all kinds of programming languages like java,springs,ajax ,hybernet?Also does it work well with windows 7.What are its other limitations
actually how many hours per one day we will work on automation(qtp) in real time
How do u retrieve data from a text file into different variables. i.e. in a text file named "source" , the data is like : india,1000,japan,200,china,50,singapore,45050 this is given in the first line of the text file. in the second line of the text file the dta is: sun,moon,planet,river,earth,water if u use "readline" method by using FSO concept u can retrieve the entire line in to a variable. but i want to import each field (ex: "india" in one variable, "1000" in another variable etc..). Apprecitae proper replies.
Will QTP gets installed on virtual PC.What is the maintenance number to be given
Can anyone pls tell me in realtime (descriptive programming) how will the properties of the object be given to the test team. R they given in an excel sheet and is the same sheet also given to the development team and by whom is this given? Thanks a lot.
How to create Reusable and Multiple Actions?
What is clean sweep?
Hi, Can any body please tell me how to create framework in qtp & where i can get some material to learn about it. regards, rahulT