SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    using QTP for ms outlook

    I need to find a way to select a certain email in microsoft outlook and then click on a hyperlink in that email. Is there a way to do it with QTP? [img]/images/graemlins/confused.gif[/img]

  2. #2
    Member
    Join Date
    Aug 2006
    Location
    Phoenix, AZ
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    I've always heard QTP doesn't play well with MS Office products, though they may have improved object recognition in the newer versions of QTP.

  3. #3
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    Do you have to go through outlook? If you are not actually testing outlook but the content of the email generated by your AUT, then why not extract the url from the hyper link in the email, then eiather check teh URL is as expected or if you have to check teh content of the URL page, then open up that URL in a browser.

    You could extract the URL using outlook DOM or even bypass the email application and extract the html from a different source.

    e.g Is the html stored in a database before generating the email via a polling mechanism?

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    Yes there is way but unfortunately you didn't take a look at our QTP FAQ post and missed the answer

  5. #5
    Member
    Join Date
    Feb 2007
    Location
    London
    Posts
    391
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    with difficulty!

    There are some Outlook examples floating about so have a look.

    When I worked on this some years back I had to do a lot of programming with the Outlook VB API so you will need to get reading up on that. One trick I found was good was to use the search feature in Outlook to find the email and then open it, that is assuming that you know the email subject.

  6. #6
    Member
    Join Date
    Sep 2006
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    Tarun, I checked FAQ section and did not find the relevant info, can you please point me to it?

    Also, how would I grab the MS outlook DOM object?

  7. #7
    Member
    Join Date
    Sep 2006
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    Here is what I've found so far to sort through the emails and choose the one I'm going to extract the hyperlink from.

    Set createapp = CreateObject("Outlook.Application")

    Set ol= createapp.GetNamespace("MAPI")
    ol.Logon


    Set fold = ol.GetDefaultFolder(olFolderInbox)

    Set InboxItems = fold.Items
    For Each Mailobject In InboxItems
    If Mailobject.UnRead Then
    ....

    Couple of snags. When I run it, it says that 'GetDefaultFolder' is not valid procedure call or argument. And also, is there a way I can select a different folder like 'Deleted Items'?

  8. #8
    Member
    Join Date
    Sep 2006
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using QTP for ms outlook

    found this online and it works:

    Set fold = ol.GetDefaultFolder(6) - not sure why

    Also, can anyone suggest the best way to find a hyperlink and click it in the body of the email message, because currently I'm parsing the body and extracting the link as a string.

  9. #9
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:09 PM.

Copyright BetaSoft Inc.