zoukankan      html  css  js  c++  java
  • 使用UI Automation实现自动化测试4.8 (GridPattern)

    GridPattern

    支持GridPattern的最常见的控件为GridView WPF中使用ListViewGridView组合即可得到相应的GridView

    GridPattern的方法

    GetItem:此方法有两个参数,即DataGridRowColumn

    通过GridPatternGetItem方法可以获取DataGrid中的某个确定的单元格,进而对单元进行操作。

    对单元格的操作主要有以下几个方面:

    1.       编辑单元个中的数据。

    2.       获取单元格中的数据。

    3.       获取单元格中嵌套的AutomationElement(一般使用与自定义控件中)。

    GridPattern的属性

    GridPatternCurrent属性中有如下两个属性:

    1.       RowCount属性:GridPattern二维表格的行数。

    2.       ColumnCount属性:GridPattern二维表格列数。

    下面我们通过一个实例来演示自动化测试中如何使用GridPattern来测试GridView的方法:

    Code

        对应的XAML代码如下:

    Code

        GridView窗体后台代码如下:

    Code

         本文主要简单介绍了GridPattern以及GridPattern在测试中是使用方法。

  • 相关阅读:
    附近地点搜索 ,地图
    网站访问量
    后台全选功能以及数据的提交方法
    首页banner特效
    等待加载提示
    缩略图轮播
    遍历input。select option 选中的值
    django1补充
    pythonweb框架django框架1
    图书馆管理系统的页面设计
  • 原文地址:https://www.cnblogs.com/kangyi/p/1573406.html
Copyright © 2011-2022 走看看