无法使用Coded UI cross hair或Inspect.exe识别ImageBrush控件

时间:2014-03-03 14:07:50

标签: automation windows-store-apps ui-automation coded-ui-tests

我正在使用Coded UI测试自动化Windows 8.1商店应用。我有一个Imagebrush控件,用户图像将在服务调用时加载。问题是我无法使用Coded UI Cross hair / Inspect.exe识别此控件,尽管它提供了自动化ID。但是可以识别图像控制。

下面的XAML有两个边框元素,在第一个边框元素中我有Imagebrush控件,在下一个边框元素中我有图像控件。在这里,我可以识别Image控件,但无法识别Imagebrush控件。我也尝试过手动编码,但它没有用。

<Border AutomationProperties.AutomationId="123" Tapped="MyProfile_Tapped">
  <Border.Background>
   <ImageBrush AutomationProperties.AutomationId="123_4" ImageSource="{Binding Profile.ProfilePhot....... />
  </Border.Background>
</Border>

<Border AutomationProperties.AutomationId="1234_5">
  <Image AutomationProperties.AutomationId="1234_6" Source="ms-appx:///Assets/Images/WatchAlbumLogo.png" />
</Border>

0 个答案:

没有答案