|
'打开网站页面
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE",_
"http://www.baidu.com/gaoji/advanced.html"
'描述对象 -- WebEdit
Set all_oEdit = Description.Create
all_oEdit("micClass").value = "WebEdit"
'为WebEdit找父对象和祖父对象,并将所有对象“包装”在一起
Set all_oEdits = Browser("micClass:=Browser").Page("micClass:=Page")._
ChildObjects(all_oEdit) 运行到这句错误了
'遍历页面中的WebEdit对象,找到一个就输入一串指定的字符串
For i = 0 to all_oEdits.count - 1
Set oEdit = all_oEdits.item(i)
oEdit.Set "QTP自动化测试技术领航"
Next
'最后记得释放所有设置的对象
Set oEdit = Nothing
Set all_oEdits = Nothing
Set all_oEdit = Nothing
感觉没错啊,但放到QTP里面就提示错误了 |
|