Micro Focus QTP (UFT) Forums
What is Window Test Object - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: What is Window Test Object (/Thread-What-is-Window-Test-Object)



What is Window Test Object - adityasrinivasb - 10-23-2013

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