Absent Member.. Absent Member..
Absent Member..

How to get parent browser object from child Link object

Set oLink = Browser("Test").Page("Test").Link("Test")

From above oLink object how do get Browser("Test") object?


2 Replies
Outstanding Contributor.
Outstanding Contributor.

Hi Bonda,

Hope you are doing well.

You can use the GetTOProperty method to get the "parent" object of a control. Once you have this object, you can then interact with this parent object as needed.

Example 1:
' Get the parent object of the WebEdit field which is Page("Google")
Browser("Google").Page("Google").WebEdit("q").Type "Mercury"
Set page_obj = Browser("Google").Page("Google").WebEdit("q").GetTOProperty("parent")
MsgBox page_obj.GetTOProperty("micclass")
page_obj.WebButton("Google Search").Click

' Get the parent object of the Page object which is Browser("Google")
Set browser_obj = page_obj.GetTOProperty("parent")
MsgBox browser_obj.GetTOProperty("micclass")

Example 2:
' Get the parent object for the Notepad Editor object
set parent_obj = Window("Notepad").WinEditor("Edit").GetTOProperty("parent")
msgbox parent_obj.GetROProperty("micclass")

Hope this may help you.

” If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given”

Ruddy Alvarez H.
Customer Support Engineer

If you find thst aat this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the pond show your appreciation.
Absent Member.. Absent Member..
Absent Member..

Hi Ruddy,

Thanks for your reply. That helped me a lot.

But how do we get parent object in Descriptive programming?

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.