Forum Discussion

sergi's avatar
sergi
Contributor
6 years ago

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_IListViewCollection_1.htm

 

Any suggestion will be much appreciated.

 

No RepliesBe the first to reply