Help get QTP to determine control

We are trying to use QTP (QuickTest Professional) to automatically test a legacy C ++ application.

However, the main application window consists of several IDENTICAL panels. Each panel has a unique title.

If I view the window in Spy ++ (comes with DevStudio) I see:

+ Window <hwnd> "Window Title" taskwindowclass
  + Window <hwnd> "Panel A" childwindowclass
    + Window <hwnd> "OK" Button
  + Window <hwnd> "Panel B" childwindowclass
    + Window <hwnd> "OK" Button

      

However, in QTP Object Spy, the hierarchy is displayed as:

+ Window: Window Title
  + WinButton: OK

      

It doesn't even show that there is a dashboard.

Does anyone know a way to get the "path" window to identify each control? that is, the controls are identified as:

Button A: "Window Title/Panel A/OK"
Button B: "Window Title/Panel B/OK"

      

+1


source to share


1 answer


You can use descriptive programming to traverse the feature map. QTP ignores panel objects by default. You can try to get a reference to the panel object dynamically and then find the ChildObjects collection to find the ok button. Another option might be to just add an ordinal identifier to the ok buttons.



  • Button A: "Window name / index OK # 1"
  • Button B: "Window title / index OK # 2"
+1


source







All Articles