用with语句写脚本后运行时提示缺少对象Util
录制好的脚本直接运行是好的,可是修改为with语句的脚本后运行时提示缺少对象“Util”,请高手帮忙解决 LZ最好把代码发上来看看 嘿,真笨,才发现少了System: 回复 2# shingo0109:) SystemUtil.Run "D:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","D:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
'Dialog("Login").Activate
'Dialog("Login").Move 459,444
'Dialog("Login").WinEdit("Agent Name:").Set "test"
'Dialog("Login").WinEdit("Agent Name:").TypemicTab
'Dialog("Login").WinEdit("Password:").SetSecure "mercury"
WithDialog("Login")
.Activate
.Move 459,444
.WinEdit("Agent Name").Set "test"
.WinEdit("Agent Name:").TypemicTab
.WinEdit("Password:").SetSecure "mercury"
End with
改成用with语句,怎么运行时会报错 实际对象库里是有对象的 没看出来有什么问题。
在简化脚本的时候,建议多用Set少用with
等你多用一下就知道为什么了。呵呵。
Set dia = Dialog("Login")
Set WEdit = dia.WinEdit("Agent Name:")
dia.Activate
dia.Move 459,444
WEdit.Set "test"
Wedit.TypemicTab
dia.WinEdit("Password:").SetSecure "mercury" WithDialog("Login")
.Activate
.Move 459,444
.WinEdit("Agent Name").Set "test"
.WinEdit("Agent Name:").TypemicTab
.WinEdit("Password:").SetSecure "mercury"
End with
改成用with语句,怎么运行时会报错
====
.WinEdit("Agent Name").Set "test" 这句话Agent Name少了冒号
应该是:.WinEdit("Agent Name:").Set "test"
页:
[1]