【发布时间】:2012-04-12 10:34:57
【问题描述】:
我想在我的 UIMap.cs(不是 UIMap.Designer.cs)中添加一个手写编码控件。
比如我录制: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 中搜索代码中的文本框?或者您想在您的应用程序中搜索具有给定值的文本框?
标签: unit-testing mstest coded-ui-tests handwriting