Textblock value in the listboxitems

May 28, 2010 at 10:26 PM

 

I am trying to get the textblock value “Number” with in XXXDataListBoxItem>grid>stackpanel using white UI. I tried as below..But couldn’t get this. Can you please help me about this.

 White.Core.UIItems.ListBoxItems.ListBox listpane = (White.Core.UIItems.ListBoxItems.ListBox)window.Get(SearchCriteria.ByAutomationId("listboxid"));

           Assert.IsNotNull(listpane, " not found");

           Thread.Sleep(1000);

           ListItems items = listpane.Items;                                                

                   WPFListItem wpfListItem = (WPFListItem)items.Item(i);

                   wpfListItem.Click(); 

                   WPFListItem ll = (WPFListItem)listpane.Get(SearchCriteria.ByAutomationId("listboxrowid"));

                   Assert.IsNotNull(ll, "not found"); 

                   White.Core.UIItems.WPFLabel number = ll.Get<White.Core.UIItems.WPFLabel>(SearchCriteria.ByAutomationId("Number"));

                  Assert.IsNotNull(number, " not found ");                           

 

XML:

<XXXWPF:XXXDataListBox.ItemTemplate>

             <DataTemplate DataType="{x:Type XXXData:ScopeInstanceBASE}">

               <XXXWPF:XXXDataListBoxItem ScopeName="GRIDROW" LogicalFieldName="GRIDROW">

                

                 <Border Name="ListBoxItemBorder" Grid.Column="1" BorderThickness="0" CornerRadius="6" SnapsToDevicePixels="True" Margin="6">

                   <!-- Main Grid -->

                    <Grid Margin="0">

                     <Grid.RowDefinitions>

                       <RowDefinition/>

                       <RowDefinition/>

                     </Grid.RowDefinitions>

 

                     <!--ROW: Split Button/Name/NUMBER-->

                    <Grid Grid.Row="0">

                       <Grid.ColumnDefinitions>

                         <ColumnDefinition Width="Auto"/>

                         <ColumnDefinition Width="*"/>

                         <ColumnDefinition Width="*"/>

                       </Grid.ColumnDefinitions>

                       <Grid Grid.Column="0"></Grid>

                       <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="3,0,3,3">

                         <TextBlock Margin="4,0" FontSize="16" FontWeight="Bold" Foreground="#FFffd535" Text="DATE[NNN].DataValue}"></TextBlock>

                       </StackPanel>

                       <StackPanel Grid.Column="2" HorizontalAlignment="Right" Orientation="Horizontal" Margin="3,0,3,3">

                         <TextBlock Margin="4,0" FontSize="16" FontWeight="Bold" Foreground="#FFffd535" Text”"></TextBlock>

                         <TextBlock Margin="4,0" FontSize="16" FontWeight="Bold" Foreground="#FFffd535" Text=" Cause # "></TextBlock>

                         <TextBlock Margin="4,0" FontSize="16" FontWeight="Bold" Foreground="LightBlue" x:Name="NUMBER" Text="{ Data[Number].DataValue}"></TextBlock>

 

                         .

.

.

 

.

.

.

.

.

</>

 

 

 Thanks,

 

May 31, 2010 at 6:57 AM

Hi

Can you see this element with UIAVerify or UISpy?

can you show us LogStructure on listpane?

 

Throndorin