Is there a way (or can one be added) to generate a FindChild alternattive from the object spy?
Here's the scenario...
We have a .NET app with devexpress controls and TC works fine with all the controls, but this level of application has about 50 objects per name. Example:
Set StatusMessage = Sys.Process("MyApp").WPFObject("HwndSource: root").WPFObject("root").WPFObject("ContentControl", "", 1).WPFObject("Grid", "", 1).WPFObject("Grid", "", 1).WPFObject("Part_WindowContent").WPFObject("Grid", "", 1).WPFObject("ContentControl", "", 1).WPFObject("PART_ContainerContent").WPFObject("barManager").WPFObject("DockPanel", "", 1).WPFObject("dockLayoutManager").WPFObject("mainLayoutGroup").WPFObject("statusMessagesLayoutPanel").WPFObject("statusMessagesGridControl")
This is a pain to read and any slight change to the path will break it.
I can use an Alias which comes out to:
Set StatusMessage = Aliases.MyApp.AS3_MainWindow.root.ContentControl.Grid.Grid.ContentControl_1.Grid.ContentControl.PART_ContainerContent.barManager.dockLayoutManager.StatusGrid.statusMessagesGridControl
But that's still a nightmare to read and when developers make small changes to the application, they often without knowing it will add additional adorner layers or groupboxes and they end up breaking the Alias. It also requires other QA coworkers to have the same Aliases setup on their machines which isn't practical.
So the best way I've found is to use the FindChild method which then lets me shrink it down to:
Set StatusMessage = Sys.Process("MyApp").FindChild("Name", "WPFObject(""statusMessagesGridControl"")", 99999)
Ultimately this is the way to go for us. It is fully dynamic and saves us a lot of maintenance. The only problem is that I have to do all this manually by grabbing the fullname and then getting the first and last objects and putting the findchild in place.
It would be ideal to have this show up as a field in the object spy
Like
Fullname: xxxxxx MappedName: yyyyyy FindChildMethod: Sys.Process("MyApp").FindChild("Name", "WPFObject(""statusMessagesGridControl"")", 99999)
Is that or could that be possible?