全部博文(87)
分类: WINDOWS
2012-10-10 12:05:35
systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set DataTable("username", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").SetSecure DataTable("passwd", dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
If Dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please try again").Check (CheckPoint("Incorrect password. Please try again")) then
reporter.ReportEvent micPass,"登陆测试","输入用户名"+DataTable("username", dtGlobalSheet)+"和密码"+DataTable("passwd", dtGlobalSheet)+"后测试成功"
else
reporter.ReportEvent micfail,"登陆测试","输入用户名"+DataTable("username", dtGlobalSheet)+"和密码"+DataTable("passwd", dtGlobalSheet)+"后测试失败"
end if
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
Dialog("Login").WinButton("Cancel").Click
调试一天终于运行成功了,需要注意的是,对登陆提示是先进行检查,即先添加检查点在进行参数化,然后再加入判断就可以了,注意:当输入正确的用户名和密码会提示错误的,但最后报告时登陆成功的,这个不知道如何去处理。