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在测试中是使用方法。

  • 相关阅读:
    实用SQL命令收集
    ZedGraph在Asp.net中的应用
    怎样制作一张万能的Win XP安装光盘
    【转】poj 1823 hotel 线段树【Good】
    【转】unique()函数
    POJ1389Area of Simple Polygons
    【转】poj 1823
    【转】POJ 1177 (线段树+离散化+扫描线) 详解
    【转】POJ各题算法分类和题目推荐
    【转】sort()函数定义在头文件<algorithm>中,它把容器中的数据重新排序成非递减序列
  • 原文地址:https://www.cnblogs.com/kangyi/p/1573406.html
Copyright © 2011-2022 走看看