0
我想向我的UIMap.cs(而不是UIMap.Designer.cs)添加一个手写编码控件。将编码控件添加到UIMap(编码UI测试)
例如,当我记录:writing in a texBox
,我得到UIMap.Designer.cs下面的代码:
public class Recorded_Writing_In_forRecordParams
{
public string UIForRecordEditText = "forRecord";
}
public class UIMainWindowWindow : WpfWindow
{
public UIMainWindowWindow()
{
this.SearchProperties[WpfWindow.PropertyNames.Name] = "MainWindow";
this.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
this.WindowTitles.Add("MainWindow");
}
public WpfEdit UIForRecordEdit
{
get
{
if ((this.mUIForRecordEdit == null))
{
this.mUIForRecordEdit = new WpfEdit(this);
this.mUIForRecordEdit.SearchProperties[WpfEdit.PropertyNames.AutomationId] = "forRecord";
this.mUIForRecordEdit.WindowTitles.Add("MainWindow");
}
return this.mUIForRecordEdit;
}
}
private WpfEdit mUIForRecordEdit;
}
我想在我CodedUITest
使用此控件。有没有办法通过自己编码在UIMap.cs
中搜索TextBox
或在我的TestMethod
中搜索它?哪种方法最好?
不知道我明白你想要做什么。为什么要在代码中搜索UIMap中的文本框?还是你想在你的应用程序中搜索具有给定值的文本框? – stoj 2012-04-12 14:18:35