Forum Discussion
HKosova
13 years agoSmartBear Alumni (Retired)
Hi Pasha,
It seems that your tested application uses docking (just like TestComplete http://smartbear.com/support/viewarticle/11346/#Basics). The behavior you are describing can happen if the application's docking layout is changed. When you dock, undock or rearrange panels, the application creates, modifies or destroys intermediate docking containers -- as a result, there are different objects in the middle of the object hierarchy.
To handle such situations, you can skip dynamic objects and use the FindChild method to locate the target object:
It seems that your tested application uses docking (just like TestComplete http://smartbear.com/support/viewarticle/11346/#Basics). The behavior you are describing can happen if the application's docking layout is changed. When you dock, undock or rearrange panels, the application creates, modifies or destroys intermediate docking containers -- as a result, there are different objects in the middle of the object hierarchy.
To handle such situations, you can skip dynamic objects and use the FindChild method to locate the target object:
var DockingManager = Sys.Process("OptionsWorkshop").WPFObject("HwndSource: MainForm").WPFObject("MainForm").WPFObject("DockPanel", "", 1).WPFObject("DockingManager");
var BaseSeriesTreeView = DockingManager.FindChild("NativeClrObject.Name", "BaseSeriesTreeView", 5);