aditya_nerkar
13 years agoOccasional Contributor
FindAllChildren isn't able to find all the elements. Looks like the object repository isn't refreshed.
Hi,
I have a WPF app whose elements are dynamically created.
I am using the FindAllChildren method to find all these elements.
// ----code---
function getChildren()
{
PropName = new Array("ClrFullClassName");
ValueName = new Array("DevExpress.Xpf.Docking.LayoutPanel");
var children = Sys.Process("MyUIProcess").WPFObject("HwndSource:self").WPFObject("self").FindAllChildren(PropName,ValueName,20,true);
}
//--endCode---
The FindAllChildren call seems to be dodgy. It's able to find only a sub set of the children.
It's only when I use the object explorer and actually highlight the remaining elements that the findallchildren method is able to find them. (in subsequent runs of the method)
Sys.Refresh() isn't helping either.
I am using TC 9.20
I have a WPF app whose elements are dynamically created.
I am using the FindAllChildren method to find all these elements.
// ----code---
function getChildren()
{
PropName = new Array("ClrFullClassName");
ValueName = new Array("DevExpress.Xpf.Docking.LayoutPanel");
var children = Sys.Process("MyUIProcess").WPFObject("HwndSource:self").WPFObject("self").FindAllChildren(PropName,ValueName,20,true);
}
//--endCode---
The FindAllChildren call seems to be dodgy. It's able to find only a sub set of the children.
It's only when I use the object explorer and actually highlight the remaining elements that the findallchildren method is able to find them. (in subsequent runs of the method)
Sys.Refresh() isn't helping either.
I am using TC 9.20