Livet er vidunderligt RSS 2.0
# Monday, 06 June 2016

<ItemsControl ItemsSource="{Binding Path=Customers, Mode=OneTime}"
             
AutomationProperties.AutomationId="CustomersItemsControl">
   
<ItemsControl.ItemTemplate>
       
<DataTemplate>
           
<TextBlock AutomationProperties.AutomationId="{Binding Path=Id, StringFormat='Customer_{0}', Mode=OneWay}"
                      
Margin="5">
               
<TextBlock.Text>
                   
<MultiBinding StringFormat="{}{1}, {0}">
                       
<Binding Path="FirstName" />
                       
<Binding Path="LastName" />
                   
</MultiBinding>
               
</TextBlock.Text>
           
</TextBlock>
       
</DataTemplate>
   
</ItemsControl.ItemTemplate>
</ItemsControl>

var itemscontrol = new WpfList(window);
itemscontrol
.SearchProperties[WpfList.PropertyNames.AutomationId] = "CustomersItemsControl";
itemscontrol
.WindowTitles.Add("MainWindow");

var count = itemscontrol.Items.Count(); // Returns the correct value!

 

http://www.codeproject.com/Questions/200959/How-to-get-AutomationID-or-name-or-unique-id-for-I

http://www.thinkfarahead.com/2010/07/assigning-automationids-dynamically-in.html

http://www.jonathanantoine.com/2011/11/03/coded-ui-tests-automationid-or-how-to-find-the-chose-one-control/

 

Monday, 06 June 2016 19:54:47 (Romance Daylight Time, UTC+02:00)  #    Comments [0] - Trackback
Software Development
Comments are closed.
Archive
<2017 October>
SunMonTueWedThuFriSat
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Christian R. Glinnum
Sign In
Statistics
Total Posts: 128
This Year: 0
This Month: 0
This Week: 0
Comments: 16
Themes
All Content © 2017, Christian R. Glinnum
DasBlog theme 'Business' created by Christoph De Baene (delarou)