ToolWindows not visible in CodedUiTest

Docking/MDI for WPF Forum

Posted 4 years ago by John Smith
Version: 15.1.0623
Avatar

Hi all,

 

i have the problem with automated CodedUiTests. My Window has few ToolWindows:

            <docking:DockSite.AutoHideRightContainers>
                <docking:ToolWindowContainer AutomationProperties.AutomationId="RightToolWindowContainerAuId" AutomationProperties.Name="RightToolWindowContainerAuName">
                    <docking:ToolWindow Title="{DynamicResource IoArSchaltung}" ImageSource="{StaticResource ImageSource}" CanClose="False" HasOptions="False" TabBackground="{DynamicResource AlIoArFarbe}">
                        <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Dock="Top">
                            <datagrid:ThemedDataGrid CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding StammMessGruppenExtendedCollection}" AutoGenerateColumns="False" SelectionMode="Single" ColumnWidth="*">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="MouseMove">
                                        <ei:CallMethodAction TargetObject="{Binding}" MethodName="OnMouseMove"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                                <datagrid:ThemedDataGrid.Columns>
                                    <DataGridTemplateColumn Header="{DynamicResource InOperationAtRest}"><!-- headertemplate test, may be error will disappear by alterauge was -->
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <StackPanel>
                                                    <RadioButton Content="{DynamicResource InOperation}" IsChecked="{Binding OperationState, UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource EnumToBoolConverter}, ConverterParameter= InOperation}" ToolTip="" HorizontalAlignment="Left"
                                                             AutomationProperties.AutomationId="" AutomationProperties.Name=""/>
                                                    <RadioButton Content="{DynamicResource AtRest}" IsChecked="{Binding OperationState, UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource EnumToBoolConverter}, ConverterParameter= AtRest}" ToolTip="" HorizontalAlignment="Left"
                                                             AutomationProperties.AutomationId="" AutomationProperties.Name=""/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>

                                    <DataGridTextColumn IsReadOnly="True" Binding="{Binding GRUPPEN_NAME, UpdateSourceTrigger=PropertyChanged}"  Header="{DynamicResource GruppenName}"/>
                                </datagrid:ThemedDataGrid.Columns>
                            </datagrid:ThemedDataGrid>
                        </DockPanel>
                    </docking:ToolWindow>

                    <docking:ToolWindow Title="{DynamicResource Ventile}" ImageSource="{StaticResource ImageSource}" CanClose="False" HasOptions="False" TabBackground="{DynamicResource AlLookupAlarmFarbe}">
                        <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Dock="Top">
                            <datagrid:ThemedDataGrid CanUserAddRows="False"  CanUserDeleteRows="False" ItemsSource="{Binding VentileCollection}" 
                                                     AutoGenerateColumns="False" ColumnWidth="*">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="PreviewMouseDown">
                                        <ei:CallMethodAction TargetObject="{Binding}" MethodName="OnVentileMouseLeftButtonDown"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                                <datagrid:ThemedDataGrid.Columns>
                                    <DataGridCheckBoxColumn  Binding="{Binding CurrentIstZuStand, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay }"  Header="{DynamicResource IstZustand}" />
                                    <DataGridTextColumn IsReadOnly="True" Binding="{Binding BEZEICHNUNG }"  Header="{DynamicResource VentilBezeichnung}"/>
                                </datagrid:ThemedDataGrid.Columns>
                            </datagrid:ThemedDataGrid>
                        </DockPanel>
                    </docking:ToolWindow>

                    <toolWindows:PropertyGridToolWindow Title="{DynamicResource Properties}" CanClose="False" HasOptions="False" TabBackground="White"/>

                    <toolWindows:ToolWindowView Title="{DynamicResource AllMessages}" CanClose="False" HasOptions="False" TabBackground="White"/>

                    <toolWindows:CreateInstrumentsToolWindow Title="{DynamicResource CreateInstruments}" />
                </docking:ToolWindowContainer>
            </docking:DockSite.AutoHideRightContainers>

 In CodedUiTest i activate one tab and can get all ToolWindows from container f.e. with GetChildren(), but they all are invisible. The activated tab is not visible too. If i try to reach an element from toolwindow i get exception. Depends that on the settings of DockSite/ToolWindow or is there another reason for that?

Regards

Comments (5)

Answer - Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

We are aware that some scenarios of Docking/MDI in CodedUI Test don't resolve names on playback correctly, even though we have the UIA tree set up properly.  In the work we are doing for Docking/MDI vNext, we are altering the object model a bit to hopefully get CodedUI Test to recognize controls better.


Actipro Software Support

Posted 4 years ago by John Smith
Avatar

Hi,

 

thank you for your response. When can we expect the next version?

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, it currently is our top new development priority but it may be a a month or two yet before the beta is ready.  Please watch our blog for details.


Actipro Software Support

Posted 4 years ago by John Smith
Avatar

That's too long for us. Can we get a temporary fix?

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Sorry but the control structure can't change in the current version without breaking everything.  We have spent a lot of time in the past verifying that the UIA tree correctly matches the control structure, and trying various adjustments, and yet CodedUI still doesn't find controls properly.  CodedUI (at least for WPF control developers) is not documented much at all either, which doesn't help matters.

When we started work on vNext, we changed the design of the control structure a bit.  This required a lot of changes to how the styles/templates work, but hopefully it helps with CodedUI finding controls better.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.