用描述性编程的方法,如下:
set obj_desc = Description.Create
obj_desc("html tag").value = "INPUT"
obj_desc("type").value = "checkbox"
dim allcheckbox,onecheckbox
set allcheckbox = Browser("Browser").Page("Page").ChildObjects(obj_desc)
for each onecheckbox in allcheckbox
onecheckbox.set "ON"
next
执行到for each onecheckbox in allcheckbox时,报:不支持此属性或方法。
改为下面的代码试试:
set obj_desc = Description.Create
obj_desc("html tag").value = "INPUT"
obj_desc("type").value = "checkbox"
dim allcheckbox,onecheckbox
set allcheckbox = Browser("Browser").Page("Page").ChildObjects(obj_desc)
for inter = 0 to allcheckbox.count -1
allcheckbox(inter).set "ON"
next