|
小弟初学QTP,斗胆发一下自己刚写的测试QTP自带订票例子的测试脚本
主要是测试登陆是否正确
Reporter.ReportEvent micDone, "Login", "开始登陆操作"
Dialog("Login").Activate
Dialog("Login").Check CheckPoint("Login")
'RunAction "Action_help", oneIteration
Dialog("Login").WinEdit("Agent Name:").Set DataTable("UserID", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").SetSecure DataTable("Password", dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
If Dialog("Login").Dialog("Flight Reservations").Exist Then
Dialog("Login").Dialog("Flight Reservations").Activate
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
Reporter.ReportEvent micDone, "Login", "登陆失败"
Dialog("Login").Activate
Dialog("Login").Close
else
Reporter.ReportEvent micDone, "Login", "完成登陆操作"
If Window("Flight Reservation").Exist Then
Window("Flight Reservation").Activate
Window("Flight Reservation").Close
Reporter.ReportEvent micDone, "Login", "退出"
End If
End If
希望可以得到各位高手的指导 |
|