|
此脚本为QTP自带飞机订票系统,脚本执行没问题,但是执行完毕后已经关闭页面,脚本会循环到首行继续执行,请问应该如何停止循环
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").SetSecure "4d88307fdaf46352606c09e590aa7f4083f34e2f"
Dialog("Login").WinEdit("Password:").Type micReturn
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "20262 DEN 10:12 AM LON 05:23 PM AA $112.20"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Test_aaa"
Dim i ,b
For i=1 to 3
Select Case i
Case 1 b=datatable.GetSheet("Global").GetParameter("A").ValueByRow(1)
'"Business"
Case 2 b=datatable.GetSheet("Global").GetParameter("A").ValueByRow(2)
'"First"
Case 3 b=datatable.GetSheet("Global").GetParameter("A").ValueByRow(3)
' "Economy"
End select
Window("Flight Reservation").WinRadioButton("text:="&b).SetTOProperty "text",b
Window("Flight Reservation").WinRadioButton("text:="&b).Set
Exit for
Next
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").Close |
|