Highlighted
New Member.
1985 views

Through UFT, I need to click on the hyperlink in outlook email body

Jump to solution

Through UFT, I need to click on the hyperlink in outlook email body.

I'm not able to do that.Could anyone help me out on this.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

The easiest and most suitable solution would be to click on the given hyperlink in the webmail solution of Outlook.

If that is not available, you can either try to do recording on Windows application through the option in "Run and Record Settings" in UFT and/or work with the Outlook Object Model directly. Material for the latter one can be found here, here and here and through this three-part article (Part 1, Part 2Part 3).

Good luck!

View solution in original post

0 Likes
2 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

The easiest and most suitable solution would be to click on the given hyperlink in the webmail solution of Outlook.

If that is not available, you can either try to do recording on Windows application through the option in "Run and Record Settings" in UFT and/or work with the Outlook Object Model directly. Material for the latter one can be found here, here and here and through this three-part article (Part 1, Part 2Part 3).

Good luck!

View solution in original post

0 Likes
Highlighted
New Member.

thanks a lot sir...now i am able toclickon the link... "issue resolved"... 🙂

Pease find the below code that i used and with which now i am able to click on the hyperlink in the mailbody

'searching for the mail subject in outlook
Set Emails = OutlookSetFolder.Items
Set Notification = Emails.GetFirst
For i = 1 to OutlookSetFolder.Items.Count
If (Notification.Subject = "Payment Confirmation") Then
Notification.Display
Exit For
End If
Set Notification = Emails.GetNext
Next
'extracting the mail body along with rich text into IE browser
sHtmlText = Notification.HTMLBody
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.Navigate "about:blank"
ie.Document.write sHTMLText
'Fetching the link count in the page
Set obj1 = Description.Create
obj1("micClass").Value = "Link"

Set obj2 = Browser("Browser").Page("Page").ChildObjects(obj1)
linkcount = obj2.count

'clicking on the link
For i = 0 To linkcount-1
urlvalue = obj2(i).getroproperty("url")
systemutil.Run "iexplore.exe",urlvalue,"","",3
Next

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.