51Testing软件测试论坛

标题: 怎样检查webtable中的webcheckbox单元格的值 [打印本页]

作者: 戒情人    时间: 2009-10-20 12:51
标题: 怎样检查webtable中的webcheckbox单元格的值
有一个webtable,其最后一列(第四列)是webcheckbox,我要检查其中某一行数据的最后一列的值,Browser("*****").Page("********").WebTable("数据列表").GetCellData(3,4) = "on"  ,这样写不行。msgbox Browser("*****").Page("********").WebTable("数据列表").GetCellData(3,4) 得到的是空。请问大家这个问题该怎样解决呢?
作者: cuixiaoyan1020    时间: 2009-10-20 13:51
标题: 回复 1# 的帖子
dim rowcount,columncount
RowCount=Browser("..............").Page(".............").Frame("................").WebTable("...........").RowCount '获取行数
ColumnCount=Browser("..........................").Page("远..................").Frame("..................").WebTable("...............").ColumnCount(4) '获取列数
msgbox "这个表是:" & RowCount  & "行" & ColumnCount & "列"
Dim arr(3,4)
dim i,j
for i=1 to rowcount
  for j=1 to columncount
  arr(i,j)=Browser("..............").Page(".............").Frame("................").WebTable("...........").getcelldata(3,4)
   msgbox "arr("&cstr(i)&","&cstr(j)&")="&arr(i,j)
   next
next
试试这样,行不行

[ 本帖最后由 cuixiaoyan1020 于 2009-10-20 14:20 编辑 ]
作者: hsjzfling    时间: 2009-10-20 14:24
可以尝试下取
WebTable("xxx").ChildItem(3,4,"WebCheckBox",0).Object.Checked
的值,为1即是"On"状态,为0则是"Off"
作者: 戒情人    时间: 2009-10-20 14:34
标题: 回复 2# 的帖子
谢谢你朋友,不过返回来还是空。
作者: 戒情人    时间: 2009-10-20 14:35
标题: 回复 3# 的帖子
谢谢你朋友,按你说的,我的问题得到了解决。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2