[英]Object required: UFT
在这里无法进一步了解。 我处于根据索引选择一个web复选框的情况。 下面是我的代码
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(...)
。
从Web表格中,我需要根据那里的索引选择webcheckbox。在这种情况下,索引从索引“ 0”开始,并且位于webtable的第二行。 行号和索引在这里不匹配。 如果索引为0,则该行为2。我需要提供一个变量,该索引将使索引增加1。我尝试在此处使用MilestoneTBLRow进行MilestoneTBL.childitem(i,1,"WebCheckBox",MilestoneTBLRow).set "ON"
,并返回错误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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.