|
我写了下登陆功能的脚本,分别对用户名密码的5种错误的情况做了研究。可是回放后,出现了5个登陆操作的dialog,但是我并没有将打开程序过程放入循环之中啊?
另外,我想在结果中输出是否成功的信息,加了if判断的检查点。但是在结果中也未能显现?
脚本如下:
'打开程序
SystemUtil.Run "F:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","F:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
'登陆过程
Dim i
For i = 1 to Datatable.GetSheet("Action1").getrowcount
Dialog("Login").WinEdit("Agent Name:").Set DataTable("AgentName", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable("Password", dtGlobalSheet)
Dialog("Login").Winbutton("OK").Click
'输出判断
if Dialog("Login").Dialog("Flight Reservations").static("MSG").GetROProperty("text") = DataTable("MSG", dtGlobalSheet) Then
reporter.ReportEvent micPass, "MSG", "MSG Pass!!!"
else
reporter.ReportEvent micFail, "MSG", "MSG Fail!!!"
End If
Dialog("Login").Dialog("text:=Flight Resrvations").Winbutton("text:=确定").Click
Next |
|