本文介绍了如何在Coded UI测试中选择datagrid中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在进行Coded UI测试。我是新手。 

Currently I am doing Coded UI Testing. I am new to this. 

当我尝试选择网格中的行时,它无法正常工作。

When i try to select row in grid it is not working.

我已经记录了Coded UI自动化。虽然我运行这个测试用例,但它不是在网格中选择行。在我的代码下面。

I have recorded though Coded UI automation. while i run this test case it is not selecting row in grid. Below my code.

我尝试了许多建议的网站上的许多示例代码。但没有什么对我有帮助。

I have tried many sample codes from many site that suggested. But nothing helps to me.

public void SelectRow()
        {
            #region Variable Declarations
            WinEdit uIEditBoxEdit = this.UIZoekschermZakenWindow.UIYesCell.UIEditBoxEdit;
            #endregion

            // Click 'Edit Box' text box
            Mouse.Click(uIEditBoxEdit, new Point(14, 5));
        }

        #region Properties
        public UIZoekschermZakenWindow UIZoekschermZakenWindow
        {
            get
            {
                if ((this.mUIZoekschermZakenWindow == null))
                {
                    this.mUIZoekschermZakenWindow = new UIZoekschermZakenWindow();
                }
                return this.mUIZoekschermZakenWindow;
            }
        }
        #endregion

        #region Fields
        private UIZoekschermZakenWindow mUIZoekschermZakenWindow;
        #endregion
    }

    [GeneratedCode("Coded UITest Builder", "14.0.23107.0")]
    public class UIZoekschermZakenWindow : WinWindow
    {

        public UIZoekschermZakenWindow()
        {
            #region Search Criteria
            this.SearchProperties[WinWindow.PropertyNames.Name] = "Zoekscherm Zaken";
            this.SearchProperties[WinWindow.PropertyNames.ClassName] = "OFormPopup";
            this.WindowTitles.Add("Zoekscherm Zaken");
            #endregion
        }

        #region Properties
        public UIYesCell UIYesCell
        {
            get
            {
                if ((this.mUIYesCell == null))
                {
                    this.mUIYesCell = new UIYesCell(this);
                }
                return this.mUIYesCell;
            }
        }
        #endregion

        #region Fields
        private UIYesCell mUIYesCell;
        #endregion
    }

    [GeneratedCode("Coded UITest Builder", "14.0.23107.0")]
    public class UIYesCell : WinCell
    {

        public UIYesCell(UITestControl searchLimitContainer) :
                base(searchLimitContainer)
        {
            #region Search Criteria
            this.SearchProperties[WinCell.PropertyNames.Name] = "Row 5, Column 1";
            this.WindowTitles.Add("Zoekscherm Zaken");
            #endregion
        }

        #region Properties
        public WinEdit UIEditBoxEdit
        {
            get
            {
                if ((this.mUIEditBoxEdit == null))
                {
                    this.mUIEditBoxEdit = new WinEdit(this);
                    #region Search Criteria
                    this.mUIEditBoxEdit.SearchProperties[WinEdit.PropertyNames.Name] = "Edit Box";
                    this.mUIEditBoxEdit.WindowTitles.Add("Zoekscherm Zaken");
                    #endregion
                }
                return this.mUIEditBoxEdit;
            }
        }
        #endregion

        #region Fields
        private WinEdit mUIEditBoxEdit;
        #endregion
    }

推荐答案

根据您的描述,您的问题与UI测试更相关。这个论坛正在讨论并询问有关Windows窗体和ClickOnce的问题,我将把这个帖子移到相应的论坛:

Visual Studio 2010和2012 Froum中的测试工具
以获取专用信息。

According to your description, your issue is more related about UI Test. And this forum is discussing and asking questions about the Windows Form and ClickOnce, I will move this thread to corresponding forum:Test Tools in Visual Studio 2010 and 2012 Froum for dedicated information.

谢谢你你的理解。

问候,

Stanly


这篇关于如何在Coded UI测试中选择datagrid中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:52