无法从 GUIGridView 读取所有行。 34 行后变为空白

问题描述 投票:0回答:1

我正在做 SAP 自动化,我正在从 GUIGridview 读取数据并使用 for 循环添加到数据表中。但在 34 行之后,每个值都是空的。然后我尝试使用条件设置当前单元格

if (行索引% 34== 0) grd.SetCurrentCell(rowindex, grd.FirstVisibleColumn);

之后我能够获取第 35 行、第 36 行的值,但再次从那里获取空白值。我总共有 91 行。

c# selenium ui-automation sap-gui
1个回答
1
投票

后端不会将所有网格行发送到前端,仅将当前查看的网格行发送到前端。

您必须通过属性

FirstVisibleRow
滚动网格,并使用其他属性
RowCount
VisibleRowCount
仅在需要时滚动。

示例:

for (int rowindex = 0; rowindex < grd.RowCount; rowindex = rowindex + 1)
{
  // Position at top if first time or scroll to display next page
  if ( rowindex % grd.VisibleRowCount == 0 )
  {
    grd.FirstVisibleRow = rowindex
  }
  // Process the line
  ...
}

更多信息:SAP 库 - GuiGridView

© www.soinside.com 2019 - 2024. All rights reserved.