Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Automate MS Outlook Operations using QTP?

This is a discussion on Automate MS Outlook Operations using QTP? within the QTP forums, part of the Software Testing category; Can we automate MS Outlook Operations using QTP? We need to find out automation tools which can automate MS Outlook. Pls help....

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 11-16-2007
Junior Member
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
kavita debroy is on a distinguished road
Automate MS Outlook Operations using QTP?

Can we automate MS Outlook Operations using QTP? We need to find out automation tools which can automate MS Outlook. Pls help.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-17-2007
Contributing Member
 
Join Date: Oct 2007
Posts: 30
Thanks: 0
Thanked 2 Times in 2 Posts
mgkganesh is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

SendTo=".......@........com"
SendToCC=".......@........com"
Subject="QTP mail"
Body1="This mail is generated from QTP Environment"
Attachment="C:\Spec.xls"

Call SendMail(SendTo, Subject, Body1, Attachment)

Function SendMail(SendTo, Subject, Body, Attachment)
Set ol=CreateObject("Outlook.Application")
Set Mail=ol.CreateItem(0)
'ol.DisplayAlerts = False
Mail.to=SendTo
Mail.CC=SendToCC
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
Reply With Quote
  #3 (permalink)  
Old 11-22-2007
Junior Member
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
kavita debroy is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Thanks for your response.

When we try to record action on outlook, QTP records this with coordinates. Do we need to add some libraries ? OR Are we required to add some particular addin to achieve this...

currently, we are using QTP 8.2 with .Net Addin enabled. Can you please provide few more pointers on this?

Thanks,
Kavita
Reply With Quote
The Following User Says Thank You to kavita debroy For This Useful Post:
  #4 (permalink)  
Old 02-07-2008
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
thavvarao is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

I have to check 60 notification that are delivered by our application to usr at different events. Each time we will check manually by stoping SMTP and verifying the mails in Pickup folder. Is there any way to read Outlook express emails with file extention .eml and verify the email notifications?
Reply With Quote
  #5 (permalink)  
Old 02-07-2008
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
thavvarao is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Set ol=CreateObject("Outlook.Application")
If i have try to creaet outlook object using above step its giving an error saying ActivX component cannot create object. Andy idea?
Reply With Quote
  #6 (permalink)  
Old 02-12-2008
Junior Member
 
Join Date: Dec 2007
Location: bengaluru
Posts: 24
Thanks: 1
Thanked 2 Times in 2 Posts
naga.sd.k is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

We can automate Outlook using QTP. .net addin should be installed.

Am working on an application totally automating outlook.... feel free to approach me
Reply With Quote
The Following User Says Thank You to naga.sd.k For This Useful Post:
  #7 (permalink)  
Old 02-24-2008
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
thavvarao is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

How we can get .net add-in?
Reply With Quote
  #8 (permalink)  
Old 12-17-2008
Junior Member
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
sunny2008 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Hi,
Can you give some idea how to read a mail from outlook express using QTP

Thanks
Reply With Quote
  #9 (permalink)  
Old 07-20-2009
Junior Member
 
Join Date: Jul 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
arijit2111 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Hi Naga,

It looks very interesting that you solved automating MS Outlook using QTP. I need your help to start the work. I am pointing out few of my queries below:-

1. .Net addin is required for Outlook automation?
2. Is it possible to verify the body contents of the mail?
3. Do we have maintain a separate mailbox for automation?
4. Any other requirements you may know that will required for QTP?

Currently i am using QTP 9.5.
Reply With Quote
  #10 (permalink)  
Old 07-21-2009
Junior Member
 
Join Date: Dec 2007
Location: bengaluru
Posts: 24
Thanks: 1
Thanked 2 Times in 2 Posts
naga.sd.k is on a distinguished road
Smile Re: Automate MS Outlook Operations using QTP?

1. .Net addin is required for Outlook automation?

Not necessary

2. Is it possible to verify the body contents of the mail?
Yes you can verify all the contents of a mail

3. Do we have maintain a separate mailbox for automation?
NO

4. Any other requirements you may know that will required for QTP?
Default QTP installation is enough to automate Outlook
Reply With Quote
The Following User Says Thank You to naga.sd.k For This Useful Post:
  #11 (permalink)  
Old 07-21-2009
Expert Member
 
Join Date: Apr 2008
Location: Tamilnadu
Posts: 1,461
Thanks: 15
Thanked 150 Times in 141 Posts
deepasree has a spectacular aura aboutdeepasree has a spectacular aura about
Re: Automate MS Outlook Operations using QTP?

hai friend,

Quote:
Originally Posted by arijit2111 View Post
Hi Naga,
1. .Net addin is required for Outlook automation?
While installing QTP it asks for addins you can select .Net addin there if needed. I don't think so we need .Net addin for outlook automation.


Quote:
Originally Posted by arijit2111 View Post
Hi Naga,
2. Is it possible to verify the body contents of the mail?
Yes it is possible

Quote:
Originally Posted by arijit2111 View Post
Hi Naga,
3. Do we have maintain a separate mailbox for automation?
not necessarily

Quote:
Originally Posted by arijit2111 View Post
Hi Naga,
4. Any other requirements you may know that will required for QTP?
Please let us know what you are looking for.

Thanks
Deepa
Reply With Quote
The Following User Says Thank You to deepasree For This Useful Post:
  #12 (permalink)  
Old 07-22-2009
Junior Member
 
Join Date: Jul 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
arijit2111 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Thanks Naga for your reply.

To be very specific, i want to know how can verify an email i:e the sender,subject,body.

If you can help me then it would be very kind of you.
Reply With Quote
  #13 (permalink)  
Old 07-22-2009
Junior Member
 
Join Date: Jul 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
arijit2111 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Deepa, thanks for your reply.

Actually i want verify an email by validating the sender,subject and body. Our system generates an email for an event. So we need to verify the same using QTP.
Reply With Quote
  #14 (permalink)  
Old 07-22-2009
Expert Member
 
Join Date: Apr 2008
Location: Tamilnadu
Posts: 1,461
Thanks: 15
Thanked 150 Times in 141 Posts
deepasree has a spectacular aura aboutdeepasree has a spectacular aura about
Re: Automate MS Outlook Operations using QTP?

Hai friend,

Some hints if an email is generated you know to whom you are sending the email so do one thing get all the senders name, subject and so on what ever you want in a datatable and then do a loop.

This is my assumption let me know how it works out.

Thanks
Deepa
Reply With Quote
  #15 (permalink)  
Old 07-23-2009
Junior Member
 
Join Date: Jul 2009
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
arijit2111 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Deepa....thanks again...whatever you suggest we can go ahead but the real issue we face is how can we make QTP identify Outlook objects or how to work with the outlook object model to verfiy an email(sender,sub,body)....
It would very helpful for me if you can provide me any sort of input for this.
Reply With Quote
  #16 (permalink)  
Old 07-23-2009
Expert Member
 
Join Date: Apr 2008
Location: Tamilnadu
Posts: 1,461
Thanks: 15
Thanked 150 Times in 141 Posts
deepasree has a spectacular aura aboutdeepasree has a spectacular aura about
Re: Automate MS Outlook Operations using QTP?

Hai arijit2111,

Set OutlookApplication = CreateObject("Outlook.Application")
Set Mail = OutlookApplication.CreateItem(0)
Mail.To = "abc@test.com" 'Enter your mail id here
Mail.Subject = "test"
Mail.Body = "this is a test"
Mail.display
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys("%s")
Set Mail = Nothing

In the above code you can view to whom you are sending the mail, subject and with this statement "Mail.display" the mail will be opened in the front end. Grab to, subject and body from the mail and store the values in variable.

Open an excel sheet it should contain to, subject, body to verify to whom the mail will be sent. So you can compare excel sheet with the values you have already stored in a variable.

Thanks
Deepa
Reply With Quote
  #17 (permalink)  
Old 07-28-2009
Junior Member
 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
juni500 is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Hi,

I have 1 req.. say a mail is send to my outlook from my application..
i want to open that mail from my inbox and check its TO list, CC list, Body and Subject fields against a standard template..

can u plss tell me how to do it ASAp.. its quite urgent
Reply With Quote
  #18 (permalink)  
Old 07-30-2009
Junior Member
 
Join Date: Dec 2008
Location: Delhi
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Vijayendra Kumar Dubey is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Quote:
Originally Posted by naga.sd.k View Post
We can automate Outlook using QTP. .net addin should be installed.

Am working on an application totally automating outlook.... feel free to approach me
Hi,

I have to automate outlook using qtp. I am using qtp 9.5. I have to read each content of an email on outlook like sender content, cc field content, subject content, attachment file name and file content , body content.
mails will be selected on search criteria.
I need methods and properties used for accessing outlook objects.
Please help me regarding this.
Reply With Quote
  #19 (permalink)  
Old 08-05-2009
Junior Member
 
Join Date: Jan 2009
Location: india
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
manivn is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Hi


Can you please check if you are able to retrieve the body and subject of the unread mails using the below code,

Set olapp = createobject("outlook.application")
set inbox = olapp.getnamespace("mapi").folders

for each fold in inbox
msgbox fold.name
getsubfolders(fold)
next

msgbox inbox.count
sub getunreadmails(objfolder)

set col = objfolder.items

for each mail in col
if mail.unread then
msgbox mail.subject
msgbox mail.sendername
msgbox mail.body
msgbox mail.senton
mail.unread=false
end if
next

end sub
sub getsubfolders(objparentfolder)
set colfolders = objparentfolder.folders
for each objfolder in colfolders
set objsubfolder = objparentfolder.folders(objfolder.name)
if objfolder.name<>"notes" then
getunreadmails(objfolder)
end if
getsubfolders objsubfolder
next
end sub


1) Copy the above script into QTP(any version)
2) try to Execute the script, it will show the unread mails information(sender, date, body, subject...etc)


Modify the above code according to your requirement
Reply With Quote
  #20 (permalink)  
Old 2 Weeks Ago
Junior Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
arnold.conchas is on a distinguished road
Re: Automate MS Outlook Operations using QTP?

Work great! how do you specify to read just one email based on the subject or sender or sent date/time?
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Check for mail in user's microsoft outlook mailbox JobHelper QTP 14 12-17-2008 07:17 AM
Renaming MS Outlook User Profile Geek_Guest Windows 1 10-26-2007 01:53 AM
AVI Toolbox: video operations at ease. JobHelper Geeks Lounge 0 08-23-2007 11:21 AM
Keep track of the DML operations performed by several users satyabrata_igate Oracle 2 07-12-2007 07:59 AM
AVI Toolbox: video operations at ease. JobHelper Geeks Lounge 0 01-15-2007 10:50 AM


All times are GMT -4. The time now is 11:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved