Micro Focus QTP (UFT) Forums
Same Pop up in different windows - 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: Same Pop up in different windows (/Thread-Same-Pop-up-in-different-windows)



Same Pop up in different windows - vamseekk - 03-25-2008

Hi,

The issue I am facing is about a pop up having an OK button with same title in different windows, i.e. for ex:
Code:
Window("Window1").Dialog("My Dialog").WinButton("OK")
SwfWindow("AnotherWindow").Dialog("My Dialog").WinButton("OK")

I would like to write a function that would take two parameters as input, say WinType for Window/SwfWindow and another parameter as WinName for Window1/AnotherWindow and the operation to be performed in the function is .Click

Code:
Call Save ("SwfWindow","AnotherWindow")

Public Function Save(WinType, WinName)
   WinTypeName = WinType & "(" & chr(34) & WinName & chr(34) & ")"
' WinTypeName = SwfWindow("AnotherWindow")
   WinTypeName.Dialog("My Dialog").WinButton("OK").Click
End Function

The following Run Time Error is displayed:
Object Required: 'WinTypeName'

Appreciate any help on the above or on handling pop up across different windows.

Thank You for reading,
Vamseekk


RE: Same Pop up in different windows - Ankur - 04-01-2008

I think qtp should be able to recognize the "different" pop ups with "same title" when coming out of "different" parent windows... just make sure that your is not the similar case as https://www.learnqtp.com/forums/Thread-Object-not-visible


RE: Same Pop up in different windows - vamseekk - 04-01-2008

Thank You for the reply Ankur.

QTP is able to recognize different pop ups uniquely based on the parent, but as you see in my question I would like to send Window Type and Window Name of the pop up as input parameters to the function and perform the click on the OK button.
Basically I would like to write a function that would take Window Type (say Window or SwfWindow or another other window type) and Window Name (say MyApp or TestApplication) as input parameters and click on OK button.

Thank You,
Vamsee