描述性编程报:不支持对象属性及方法
代码和提示信息见图片所示意。代码部分是从资料里摘抄来的,运行报错 SystemUtil.Run "flight4a.exe","","D:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"Dim username(3)
username(0) = "user"
username(1) = "user1"
username(2) = "user2"
For i=0 to 2
Dim myDesc
Set myDesc=Description.Create()
myDesc("Class Name").Value = "Dialog"
myDesc("regexpwndtitle").Value = "Login"
Dim desc_test
Set desc_test=Description.Create()
desc_test("Class Name").Value="WinEdit"
desc_test("text").value=""
desc_test("attached text").Value="Agent Name:"
set bb = desktop.ChildObjects(desc_test)
Msgbox bb.count
desc_test("text").Value=username(i)
Dialog(myDesc).WinEdit(desc_test)
Dialog(myDesc).WinEdit("Attached text:=Password:").Set "mercury"
Dialog(myDesc).WinButton("text:=Cancel").Click
Next
图片有点暗,添上代码部分 问题已解决:将原来的Dialog(myDesc).WinEdit(desc_test)修改为:
Dialog(myDesc).WinEdit(desc_test).Set username(i)
运行通过,之前的 'desc_test("text").value=""和' desc_test("text").Value=username(i)注释掉 回复 3# fengxinzi0151
有个问题,你description中锋装的class name属性。
系统能找到这个对象么?
页:
[1]