所需对象:UFT

Object required: UFT

这里无法继续。我处于一种情况,我必须根据索引 select 一个 webcheckbox。下面是我的代码

Set Brw = Browser("title:=.*").Page("title:=.*")

MilestoneTBLRow=brw.webtable("cols:=7","column names:=;Milestone Name;Milestone Date;Description;Created Time;Modified Time;Action").RowCount

MilestoneTBLCol=Brw.webtable("cols:=7","column names:=;Milestone Name;Milestone Date;Description;Created Time;Modified Time;Action").ColumnCount(1)

For i = 2 To MilestoneTBLRow  Step 1
    set MilestoneTBL = Browser("title:=.*").Page("title:=.*").webtable("cols:=7","column names:=;Milestone Name;Milestone Date;Description;Created Time;Modified Time;Action")
    `MilestoneTBL.childitem(i,1,"WebCheckBox",0).set "ON"
    Browser("title:=.*").Page("title:=.*").WebButton("name:=Mass Edit","type:=button","html tag:=INPUT","index:=0").click
    btnSave "0"
Next

错误发生在Object required: 'MilestoneTBL.childitem(...)
在 Webtable 中,我需要 select webcheckbox,具体取决于 index.In 在这种情况下,索引从索引“0”开始,它位于 Webtable 的第二行。行号和索引在这里不匹配。如果索引为 0,则该行为 2。我需要提供一个变量,该变量将使索引不断增加 1。我已经尝试在此处使用 MilestoneTBLRow MilestoneTBL.childitem(i,1,"WebCheckBox",MilestoneTBLRow).set "ON" & 那returns 一个错误 Object required: 'MilestoneTBL.childitem(...)

你能在这里纠正我吗?

创建一个临时变量并在 'for' 循环中递增该变量

temp=0
*Set Brw = Browser("title:=.*").Page("title:=.*")
MilestoneTBLRow=brw.webtable("cols:=7","column names:=;Milestone           Name;Milestone Date;Description;Created Time;Modified Time;Action").RowCount
MilestoneTBLCol=Brw.webtable("cols:=7","column names:=;Milestone Name;Milestone Date;Description;Created Time;Modified Time;Action").ColumnCount(1)
For i = 2 To MilestoneTBLRow  Step 1
set MilestoneTBL =   Browser("title:=.*").Page("title:=.*").webtable("cols:=7","column  names:=;Milestone Name;Milestone Date;Description;Created Time;Modified Time;Action")
`MilestoneTBL.childitem(i,1,"WebCheckBox",temp).set "ON"
 Browser("title:=.*").Page("title:=.*").WebButton("name:=Mass Edit","type:=button","html tag:=INPUT","index:=0").click
btnSave "0"
temp=temp+1
Next