WPFObject grid
Hi,
I am unable to retrieve cell value from wpf object grid. Have tried different options but it didn't work. Object hirarchy is below. Can you pls suggest?
NameMapping.Sys.Process("Jpmc.Etrading.Mati.MainShell.Credit").WPFObject("HwndSource: XpfRibbonShellView", "Credit Insight NA UAT | 1.9.5.2361").WPFObject("XpfRibbonShellView", "Credit Insight NA UAT | 1.9.5.2361", 1).WPFObject("ContentControl", "", 1).WPFObject("Grid", "", 1).WPFObject("Grid", "", 1).WPFObject("ContentControl", "", 2).WPFObject("Grid", "", 1).WPFObject("ContentControl", "", 1).WPFObject("PART_ContainerContent").WPFObject("shellContent").WPFObject("Grid", "", 1).WPFObject("barManager").WPFObject("DockPanel", "", 1).WPFObject("mainWorkspace").WPFObject("dockLayoutManager").WPFObject("dockItem1").WPFObject("item6").WPFObject("item7").WPFObject("rootControl").WPFObject("Grid", "", 1).WPFObject("grid").WPFObject("gridView")
- I was running in a similar problem with WPF testing.
I ended up using the FileChild routine to drill down through a large number of levels.
What I use is:
Set toolgrid = animPanel.FindChild("Name", "WPFObject(""Tool_Grid"")", 19)
Set wpfHP = toolgrid.FindChild("Name", "WPFObject(""Gauge_HP"")", 9)
Set gaugeHP = wpfHP.FindChild("Name", "WPFObject(""MyReading"")", 9)
Where animPanel was preiously defined for the user control UI.
The toolgrid is the top level of the WPF components within the animation pannel.
The wpfHP is a branch top for the gauge I want to read.
gaugeHP is where the actual value I want to read.
I also found this to be 10 times faster to initilize than specifying a single, very long, Set statement.
Don't ask me why it would be faster, I have a Forum topic started on the why.
it also makes it easier to debug, less likely to break should the developer makes a change, and easier to read.