cancel
Showing results for 
Search instead for 
Did you mean: 

How to find a generic ItemsControl in WPF app

Contributor

How to find a generic ItemsControl in WPF app

I want to find a list in my WPF app that is an ItemsControl view.

 

In case it is a ListBox instead of ItemsControl I do the following (which works fine):

 

 

IDriver driver = new LocalDriver();
IProcess process = localDriver.Find<IProcess>(new ProcessPattern {ProcessName = "MyApp"});
IListBox items = this.process.Find<IListBox>(new WPFPattern { WPFControlAutomationId = "items" }, 10);

 

But that doesn't work for ItemsControl. I've seen there's IListViewCollection<T> that sounds like something useful but I haven't managed to make it work and the documentation is not useful at all here.

http://support.smartbear.com/docs/testleft/net-reference/html/T_SmartBear_TestLeft_TestObjects_IList...

 

Any suggestion will be much appreciated.

 

New Here?
Join us and watch the welcome video:
Update to TestLeft 2.3
Labels