WPF ListItem with complex content

Apr 1, 2010 at 9:13 PM

I have a ListBox control whose list items have complex content (TextBoxes, Expanders, etc).  First, I can not find any elements in a list box item using window.Get().  Built in UIAutomation has the same problem. TreeWalker won't walk into the content, for example.  Second, when I have white;'s ListItem or WPFListItem, I can't seem to get the controls within the item.  The UIItems page (http://white.codeplex.com/wikipage?title=UI Item) WPFItems section suggests that WPFListItem has a Get<T>( SearchCriteria) method, but there is no such method in the current (trunk) build of White.

Any suggestions as to how to get that content through automation?

Thanks.

Apr 6, 2010 at 6:50 AM

Hi

 

Sometimes I have the same problem with some elements (TextBox in TextBox or something like that)

 

In that case I uses something  like that:

AutomationElement element = parent.GetElement(SearchCriteria.ByAutomationId("id"));

TextBox box = new TextBox(element, parent.ActionListener);

 

to get a White element

 

Note:

on WPF Get<> is available on each element if you use

using White.Core.UIItems.WPFUIItems;

 

Throndorin