TA的每日心情 | 开心 2017-9-6 17:42 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
这是一个很简单的登录测试,但是当我运行到错误密码时,不能进入IF的判断语句
If dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").Exist(5) Then
这句话是不是不能运行进IF语句,但是Exist能自动联想出- SystemUtil.Run PathFinder.Locate("..\samples\flight\app\flight4a.exe"),"",PathFinder.Locate("..\samples\flight\app"),"open"
- Dialog("Login").WinEdit("Agent Name:").Set DataTable("username", dtLocalSheet)
- Dialog("Login").WinEdit("Password:").Set DataTable("password", dtLocalSheet)
- Dialog("Login").WinButton("OK").Click
- If Window("Flight Reservation").Exist(5) Then
- reporter.ReportEvent micPass ,"登录验证","登录成功"
- Window("Flight Reservation").Close
- else
- reporter.ReportEvent micFail ,"登录验证","登录失败"
- End If
- If dialog("Login").Dialog("Flight Reservations").Static("Agent name must be at").Exist(2)then
- Dim err_message
- err_message = dialog("Login").Dialog("Flight Reservations").Static("Agent name must be at").GetROProperty("text")
- reporter.ReportEvent micFail,"登录失败","错误信息是:"&err_message
- dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
- dialog("Login").WinButton("Cancel").Click
- 'else
- 'reporter.ReportEvent micPass,"登录成功","登录成功"
- 'window("Flight Reservation").Close
-
- End If
- If dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").Exist(5) Then
- Dim err_messager
- err_messager=dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").GetROProperty("text")
- reporter.ReportEvent micFail,"登录失败","错误信息是:"&err_messager
- dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
- dialog("Login").WinButton("Cancel").Click
- End If
- If dialog("Login").Dialog("Flight Reservations").Static("Please enter agent name").Exist(5) Then
- Dim err_name
- err_name=dialog("Login").Dialog("Flight Reservations").Static("Please enter agent name").GetROProperty("text")
- reporter.ReportEvent micFail,"登录失败","错误信息是:"&err_name
- dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
- dialog("Login").WinButton("Cancel").Click
-
- End If
- If dialog("Login").Dialog("Flight Reservations").Static("Please enter password").Exist(5) Then
- Dim err_password
- err_password=dialog("Login").Dialog("Flight Reservations").Static("Please enter password").GetROProperty("text")
- reporter.ReportEvent micFail,"登录失败","错误信息是:"&err_password
- dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
- dialog("Login").WinButton("Cancel").Click
-
- End If
复制代码 来,说明这句话是对的,为什么进入不了呢? |
|