有沒有辦法強制編碼的UI測試生成器使用它已經記錄的類? 它甚至可以在單個記錄會話中創建非常類似的類。編碼的UI測試生成器記錄類似的類,在UIMap中創建大量的類
E.g.下面生成的兩個類中的唯一區別。 我想重用代碼 - 沒有意義有這樣的重複。除了手動清理之外的任何事情?
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中新類的數量?
感謝
尤里