Suddenly unable to find WPFObject
- 4 months ago
I almost can't believe it, but I seem to have fixed this issue. Still stumped as to why it happened in the first place, but I'll attempt to explain how I seem to have fixed it.
So the Menu Item I'm trying to select, "Connections", is an item in our object "Menu". But for reasons unknown, it was no longer being able to be recognized, for no obvious reason. Point & Fix couldn't select it either.
But I was looking through the NameMapping and noticed that everything in the menu was below a node called "Popup". I guess this is a WPF thing? One of our devs explained it to me recently but I only vaguely grasped it.
Anyway, this got me thinking... so I went to remap the object "Popup" (which was not locatable nor viewable in the Object Browser) but I wasn't sure what to select from the Spy. I decided to highlight the boundary AROUND all the menu items (which was tricky as there's only a couple of pixels that cause it to select):
As SOON as I did this, everything behaved again! The Menu TC had previously recorded now works perfectly again:
"MENU|Connections|[4]"
And my variable version that generates it dynamically, also works perfectly:
"MENU|Connections|[" + str(Project.Variables.Counter) + "]"
Amazing. So, at least now if this happens again, I'll have some idea of how to fix it. I just wish I knew what on earth happened in the first place!