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. |
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....
|
|||||||
|
|||
|
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 |
|
|||
|
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 |
| The Following User Says Thank You to kavita debroy For This Useful Post: | ||
|
|||
|
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?
|
|
|||
|
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? |
|
|||
|
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 |
| The Following User Says Thank You to naga.sd.k For This Useful Post: | ||
|
|||
|
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. |
|
|||
|
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 |
| The Following User Says Thank You to naga.sd.k For This Useful Post: | ||
|
|||
|
Re: Automate MS Outlook Operations using QTP?
hai friend,
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:
Quote:
Quote:
Thanks Deepa |
| The Following User Says Thank You to deepasree For This Useful Post: | ||
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
Re: Automate MS Outlook Operations using QTP?
Quote:
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. |
|
|||
|
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 |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |