51Testing软件测试论坛

标题: UI测试,自定义的下拉框,不能识别,怎么办? [打印本页]

作者: 测试积点老人    时间: 2020-2-18 11:39
标题: UI测试,自定义的下拉框,不能识别,怎么办?
UI测试,自定义的下拉框,不能识别,怎么办?
使用vs的UI测试,点击多个自定义的下拉框(是个组合控件),下拉列表都识别为同一个控件
请问怎么处理?
[GeneratedCode("编码的 UI 测试生成器", "11.0.50727.1")]
public class UIItemWindow3 : WinWindow
{
    public UIItemWindow3()
    {
        #region 搜索条件
        this.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "DropDown";
        this.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
        #endregion
    }
   
    #region Properties
    public WinMenu UIDropDownMenu
    {
        get
        {
            if ((this.mUIDropDownMenu == null))
            {
                this.mUIDropDownMenu = new WinMenu(this);
                #region 搜索条件
                this.mUIDropDownMenu.SearchProperties[WinMenu.PropertyNames.Name] = "DropDown";
                #endregion
            }
            return this.mUIDropDownMenu;
        }
    }
    #endregion
   
    #region Fields
    private WinMenu mUIDropDownMenu;
    #endregion
}


作者: bellas    时间: 2020-2-19 10:22
元素识别不到
作者: jingzizx    时间: 2020-2-19 13:06
xpath进行识别




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2