无法访问groupBox winappdriver中的按钮

问题描述

我正在尝试访问GroupBox中包含的按钮。在这里,我将xaml代码段放在创建此按钮的位置。

<GroupBox Grid.Row="2" Grid.Column="1" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="5,5,5" x:Name="LayerSelectionWall" Header="{x:Static properties:WallsEditorProResources.LayerSelectSplitLayersText}">

...我省略了不必要的代码

<Button Grid.Column="2" IsEnabled="{Binding IsEnable,Mode=OneWay}" Style="{DynamicResource SquareButtonStyle}" x:Name="RemoveLayerSet" Content="{x:Static properties:WallsEditorProResources.LayerCreatorSplitInSingleLayerText}" FontSize="12" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5,5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ToolTip="{x:Static properties:WallsEditorProResources.LayerCreatorSplitLayer}" Click="Split_OnClick"/>

为了找到按钮,我执行以下操作,其中“ Split Wall Layers”是groupBox所在的窗口

rootSession.FindElementByName("Split Wall Layers").FindElementByAccessibilityId("LayerSelectionWall")..FindElementByWindowsUIAutomation("RemoveLayerSet").Click(); 

很遗憾,我找不到此元素。在调试它时,我发现了GroupBox的问题,但找不到。这个组件有问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)