TA的每日心情 | 开心 2015-4-13 19:27 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
本帖最后由 liudinglong1989 于 2015-4-13 21:57 编辑
我要录制的场景是:系统自带的订票系统,有个help按钮,单击后弹出的那个告诉我们密码那个窗口,我想不管有没有这个窗口,程序都从输入账号和密码开始。
代码如下:
If Dialog("Login").Dialog("Flight Reservations").Exist(3) Then
Diglog("Login").Dialog("Flight Reservations").WinButton("确定").Click
End If
Dialog("Login").WinEdit("Agent Name:").Set "test111"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").SetSecure "552a768a07cb59e196795278dd578cd59be67fcc"
Dialog("Login").WinButton("OK").Click
Dialog("Flight Reservations").WinButton("确定").Click
Dialog("Login").WinEdit("Password:").SetSecure "552a7694593799f4602d54a64c1f390c24bd8864"
Dialog("Login").WinButton("OK").Click
Dialog("Flight Reservations").WinButton("确定").Click
Dialog("Login").WinButton("Help").Click
Dialog("Flight Reservations").WinButton("确定").Click
Dialog("Login").WinEdit("Password:").SetSecure "552a769fffb80ae3ee131d8abd44a62ce067bcb2"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "13" + micLeft
Window("Flight Reservation").ActiveX("MaskEdBox").Type micBack
Window("Flight Reservation").ActiveX("MaskEdBox").Type micBack
Window("Flight Reservation").ActiveX("MaskEdBox").Type "081315"
Window("Flight Reservation").ActiveX("MaskEdBox").Type micTab
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "TET"
Window("Flight Reservation").WinEdit("Name:").SetSelection 0,3
Window("Flight Reservation").WinEdit("Name:").Set "TEST"
Window("Flight Reservation").WinButton("&Insert Order").Click
Window("Flight Reservation").Activate
Window("Flight Reservation").Close
************************************
If Dialog("Login").Dialog("Flight Reservations").Exist(3) Then
Diglog("Login").Dialog("Flight Reservations").WinButton("确定").Click
End If
红色下面的代码都可以正常跑完,红色代码自己敲的,放在最前面,来判断图片1这种场景,可是不知道为啥会报错,请大神指点,要详细点,谢谢了。可加QQ:136633063,求好心人帮忙解决,我是一名初学者。
|
|