コード化された UI テスト ビルダーに、既に記録されているクラスを強制的に使用させる方法はありますか? 単一の記録セッション内でも、非常によく似たクラスが作成されます。
たとえば、以下で生成された 2 つのクラスの URL の唯一の違い。コードを再利用したいのですが、そのような重複は意味がありません。手動クリーンアップ以外に何かありますか?
public class UISearchResultsOracleDocument : HtmlDocument
{
public UISearchResultsOracleDocument(UITestControl searchLimitContainer) :
base(searchLimitContainer)
{
#region Search Criteria
this.SearchProperties[HtmlDocument.PropertyNames.Id] = null;
this.SearchProperties[HtmlDocument.PropertyNames.RedirectingPage] = "False";
this.SearchProperties[HtmlDocument.PropertyNames.FrameDocument] = "False";
this.FilterProperties[HtmlDocument.PropertyNames.Title] = "Search Results : " + EnterSearchedTextParams.UISearchEditText;
this.FilterProperties[HtmlDocument.PropertyNames.AbsolutePath] = "/project/Pages/results.aspx";
this.FilterProperties[HtmlDocument.PropertyNames.PageUrl] = "http://my.url.com:123/project/Pages/results.aspx?k=Oracle";
this.WindowTitles.Add("Search Results : Oracle");
#endregion
}
// ...
}
//そしてほぼ重複
public class UISearchResultsOracleDocument1 : HtmlDocument
{
public UISearchResultsOracleDocument1(UITestControl searchLimitContainer) :
base(searchLimitContainer)
{
#region Search Criteria
this.SearchProperties[HtmlDocument.PropertyNames.Id] = null;
this.SearchProperties[HtmlDocument.PropertyNames.RedirectingPage] = "False";
this.SearchProperties[HtmlDocument.PropertyNames.FrameDocument] = "False";
this.FilterProperties[HtmlDocument.PropertyNames.Title] = "Search Results : Oracle";
this.FilterProperties[HtmlDocument.PropertyNames.AbsolutePath] = "/project/Pages/results.aspx";
this.FilterProperties[HtmlDocument.PropertyNames.PageUrl] = "http://my.url.com:123/project/Pages/results.aspx?k=Oracle&start1=1";
this.WindowTitles.Add("Search Results : Oracle");
#endregion
}
// ...
}
したがって、問題は重複をどのように排除するかです。UIMap の新しいクラスの数を減らすためのヒントはありますか?
ありがとう
百合