WebApp の CodedUI テストを手作業でコーディングしています。Web アプリは約 50% の Silverlight です。親オブジェクトの Web ページを検索する HtmlCustom コントロールがあります。次に、メイン ページ テンプレートの SilverlightControl を作成するために使用されます。ページ テンプレートには ID も関連付けられています。Web アプリの他の領域にこのコードがあり、正常に動作しますが、何らかの理由でここでは動作しません。
/// <summary>
/// Parent of UIControlViewPlaylistsXAP
/// </summary>
private HtmlCustom mUICustomViewPlaylistsXAP;
private HtmlCustom UICustomViewPlaylistsXAP
{
get
{
if (this.mUICustomViewPlaylistsXAP == null)
{
this.mUICustomViewPlaylistsXAP = new HtmlCustom(this);
this.mUICustomViewPlaylistsXAP.SearchProperties.Add(HtmlCustom.PropertyNames.Id, "viewPlaylistsObject");
this.mUICustomViewPlaylistsXAP.SearchProperties.Add(HtmlCustom.PropertyNames.TagName, "OBJECT");
this.mUICustomViewPlaylistsXAP.SearchProperties.Add(HtmlCustom.PropertyNames.ControlDefinition, "data=\"data:application/x-oleobject;base64", PropertyExpressionOperator.Contains);
}
return this.mUICustomViewPlaylistsXAP;
}
}
/// <summary>
/// Parent of all direct Page: View Playlists controls
/// </summary>
private SilverlightControl mUIControlViewPlaylistsXAP;
public SilverlightControl UIControlViewPlaylistsXAP
{
get
{
if (this.mUIControlViewPlaylistsXAP == null)
{
this.mUIControlViewPlaylistsXAP = new SilverlightControl(this.UICustomViewPlaylistsXAP);
this.mUIControlViewPlaylistsXAP.SearchProperties.Add(SilverlightControl.PropertyNames.AutomationId, "VisiconnPageTemplate");
////this.mUIControlViewPlaylistsXAP.SearchProperties.Add(SilverlightControl.PropertyNames.MaxDepth, "-1");
this.mUICustomViewPlaylistsXAP.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
//// this.mUIControlViewPlaylistsXAP.SearchProperties.Add(SilverlightControl.PropertyNames.ControlType, "VisiconnPageTemplate");
}
return this.mUIControlViewPlaylistsXAP;
}
}
そのため、mUIControlViewPlaylists.XAP はそれに関連付けられた AutomationId を持つ UITestControlNotFoundException を返します。これを行うためのより良い方法や一般的な問題についてのアイデアがあれば、きっと感謝します。