Micro Focus QTP (UFT) Forums

Full Version: What is Window Test Object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a scenario where I am handling IE exception messages from webpage using a function call in a recovery scenario. Can somebody please clarify the following in the function

Code:
Function Recovery_LoginProxy(Object)

'Get the handle of the window
HwndPwdWindow = Object.GetROProperty("hwnd")

'Get the window test object for the same
Set pwdWindow = Window("hwnd:=" & HwndPwdWindow)

pwdWindow.WinButton("text:=OK").click

What is window test object above? I see that if I use Object.Winbutton("text:=OK").click, QTP does not click the Ok button in the dialog. But when I get the Window test object , I get QTP to click on the OK button in the dialog with the statement pwdWindow.WinButton("text:=OK").click. What is pwdWindow object above? Why I pass the dialog handle in to the object. What is happening in the above two lines of code? Can somebody please explain?

Regards
Srinivas