Micro Focus QTP (UFT) Forums
One common code line in QTP to handle two different widows in QTP - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: One common code line in QTP to handle two different widows in QTP (/Thread-One-common-code-line-in-QTP-to-handle-two-different-widows-in-QTP)



One common code line in QTP to handle two different widows in QTP - hemu_a - 02-04-2009

Hi,

I have a scenario, wherein my QTP script which runs on windows OS, handles same application on two different OS (windows and Nonstop). On windows it is directly handled by window class and on nonstop an emulator called OutsideView is used.

When I record the same set of instructions on these two OS, windows and Nonstop the code is as below.

For Windows:

Code:
Window("Application Execution").Activate
Window("Application Execution").Type  micF5
Window("Application Execution").Activate
Window("Application Execution").Type  micF8
Window("Application Execution").Activate
Window("Application Execution").Type  micF9
Window("Application Execution").Activate
Window("Application Execution").Type  micF10
Window("Application Execution").Activate
Window("Application Execution").Type  micF11
Window("Application Execution").Activate
Window("Application Execution").Type  micF3


For Nonstop:

Code:
Window("OutsideView").Window("Tandem 5*").Activate
Window("OutsideView").WinObject("FKey").Click 112,15
Window("OutsideView").WinObject("FKey").Click 183,13
Window("OutsideView").WinObject("FKey").Click 204,13
Window("OutsideView").WinObject("FKey").Click 228,16
Window("OutsideView").WinObject("FKey").Click 256,16
Window("OutsideView").WinObject("FKey").Click 75,17
Window("OutsideView").Window("Tandem 5*").Activate
Window("OutsideView").WinObject("FKey").Click 69,12


In the above two scenarios,the application on WINDOWS os is recognised as ANSIWINDclass and on Nonstop OS it is recognised as Outsideview Class.

My query is that, is there a way in QTP, that a single line of common code can handle the operation (ex. clicking F5 Function Key) on both the OS.