|
使用QTP测试QTP自带的flight程序登陆部分
录制的脚本如下:
Dim hint_msg
Dim hint
‘参数化user和password值
Dialog("Login").WinEdit("Agent Name:").Set DataTable("user", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").SetSecure DataTable("password", dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
hint = DataTable("hint", dtGlobalSheet)
'如果弹出错误提示框,通过对比hint 与判断错误提示框信息是否一致来判断程序是否正确进行判断
If Dialog("Login").Dialog("Flight Reservations").Exist Then
hint_msg = Dialog("Login").Dialog("Flight Reservations").Static.GetROProperty("text")
If (hint = hint_msg) Then
Reporter.ReportEvent micpass, "登陆", "程序判断正确."
else
Reporter.ReportEvent micFail, "登陆", "程序判断错误."
End If
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
End If
运行脚本后QTP弹出下面窗口
The "Flight Reservations" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.
Line (9): "If Dialog("Login").Dialog("Flight Reservations").Exist Then".
但是Dialog("Login").Dialog("Flight Reservations")是弹出来了,为什么会提示不存在
大家帮忙看下我的脚本哪里出错了,谢谢了 |
|