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的方法:

    对应的XAML代码如下:

    GridView窗体后台代码如下:

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

相关文章:

  • 2022-02-07
  • 2021-11-30
  • 2021-07-13
  • 2021-11-18
  • 2021-11-29
  • 2021-09-05
  • 2021-12-04
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-05-24
  • 2021-07-20
  • 2021-05-21
  • 2021-11-18
相关资源
相似解决方案