Search code examples
qtphp-uft

clicking on a link in an email using qtp


I'm trying to open an autogenerated url sent in an email as part of an activation process. I am unable to get qtp to open that link. Infact,I don't know how to do it.

Any help will be highly appreciated.

Thanks!


Solution

  • In your record settings you can set the options to record windows applications (location Record > Record and Run Settings > Windows Applications). Here is an example of a script that clicks a login link from an email from stackoverflow -- using UFT 12:

    'To open Outlook
    SystemUtil.Run "OUTLOOK.EXE"
    Window("Microsoft Outlook").Activate
    
    'Double click the top message in the inbox
    Window("Outlook Inbox Column").WinObject("Table View").DblClick 118,72
    
    'Find the location of the link within the Message
    Window("Message (HTML)").WinObject("Message").Click 212,324
    
    'Verify the link brought me to the Stack Overflow Login page
    Browser("Add a login - Stack Overflow").WinObject("AddressDisplay Control").Check CheckPoint("AddressDisplay Control")