|
Dim istatus
Dim text1
SystemUtil.Run "D:/Program Files/Mercury Interactive/QuickTest Professional/samples/flight/app/flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set DataTable("p_Text", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").SetSecure "482a67de313480a4f613a9f60fbd2a8651b05396"
istatus=DataTable("status",dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
If Dialog("Login").Dialog("Flight Reservations").Exist Then //判断第三方界面是否存在,即错误警告界面
text1=Dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").GetROProperty("Text") //存在获取界面的Text值赋予text1
if text1= istatus then //如果Text是预期结果的值,打印text1
Reporter.ReportEvent micPass, "失败",text1
else
Reporter.ReportEvent micFail,"异常","有错误" // 否则异常
end if
wait(2) //可有可无
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click //关掉错误警告界面
Dialog("Login").WinButton("Cancel").Click //关掉本次登录界面,便于下一个循环
else
Reporter.ReportEvent micPass, "成功","登录成功" //错误警告界面不存在,则登录成功
Window("Flight Reservation").Close
End If |
|