QTP录制Windows程序,为什么点一下键盘就录制为一个步骤啊
录制Windows程序,Record and Run Settings 选择的是 Applications opend via the Desktop (by the Windows shell),为什么录制时,输入密码,点一下键盘就录制一个步骤啊?录制代码如下所示:SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").TypemicTab
Dialog("Login").WinEdit("Password:").Type "m"
Dialog("Login").WinEdit("Password:").SetSecure "4cf8688da7d72337"
Dialog("Login").WinEdit("Password:").Type "e"
Dialog("Login").WinEdit("Password:").SetSecure "4cf8688da7d74637ba28"
Dialog("Login").WinEdit("Password:").SetSecure "4cf8688e3ce3ecbe475d1260"
Dialog("Login").WinEdit("Password:").Type "c"
Dialog("Login").WinEdit("Password:").SetSecure "4cf8688e3ce3ecbe475d7160b75f"
Dialog("Login").WinEdit("Password:").Type "u"
Dialog("Login").WinEdit("Password:").SetSecure "4cf8688fd13b204f4d04e3270d742a34"
Dialog("Login").WinEdit("Password:").Type "r"
Dialog("Login").WinEdit("Password:").SetSecure "4cf86890621f2cabb10977be531789a3c494"
Dialog("Login").WinEdit("Password:").Type "y"
Dialog("Login").WinEdit("Password:").SetSecure "4cf86890621f2cabb10977be531789a3bd947638"
Dialog("Login").WinButton("Cancel").Click
输入用户名也是是同样的问题。怎么解决啊? QTP对键盘做了监听。
你的脚本可以做一下改写。
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe“
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinButton("OK").Click '这里应该是录制“OK”,估计你录制错误了, 你需要录制 点击OK这一步
'如果想参数化,可改写为
ID="mercury"
PassWord="mercury"
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe“
Dialog("Login").WinEdit("Agent Name:").Set ID
Dialog("Login").WinEdit("Agent Name:").Set PassWord
Dialog("Login").WinButton("OK").Click 那请问一下,在哪里设置可以取消对键盘的监听啊 你遇到的问题可以参照下该帖子
http://bbs.51testing.com/thread-436513-1-2.html :loveliness: 原来是翻译软件啊
页:
[1]