Silverlight Object hierachy becomes misaligned/jumbled when scroll methods are invoked.
I'm in the process of building a function that can select an item in a SilverLight listbox by its text value(textblock object which is a child of a list box item).
SilverLight only loads the the textblock objects for the list items that are visible on screen.
For example, if a list has "Item 1" to "Item 100" and only 10 are viewable on screen at any one time and only 10 items will have textblock objects in the object tree.
So, in order to interogate the rest of the 90 items, we need to scroll down so that they are loaded into the object tree.
This is easy to do, since UIAutomation provides methods and properties for scrolling.
However, the object hierachy in TestComplete becomes completely misaligned (jumbled) as we scroll down the list...
E.g.
- Before scrolling, Item 3 has a textblock of "Item 3".
- After scrolling and looking at this in the object browser, it has "Item 17".
Therefore, trying to select "Item 3" (using the addToSelection method on it's parent), selects a random item...
Have tried using Sys.Refresh, Sys.Process("...").Refresh, and object.refresh everywhere, but to no avail.
I suspect this is a TestComplete issue, since shutting down TestComplete completely and reopening TestComplete, the objects appear aligned again.
Is there a known solution or workaround for this.
I.e. Is there are way to force TC to completely rebuild the object tree?
We're using TestComplete 7.52.
Thanks
Evan