请一下脚本如何停止循环
此脚本为QTP自带飞机订票系统,脚本执行没问题,但是执行完毕后已经关闭页面,脚本会循环到首行继续执行,请问应该如何停止循环Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").TypemicTab
Dialog("Login").WinEdit("Password:").SetSecure "4d88307fdaf46352606c09e590aa7f4083f34e2f"
Dialog("Login").WinEdit("Password:").TypemicReturn
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
Case1b=datatable.GetSheet("Global").GetParameter("A").ValueByRow(1)
'"Business"
Case2 b=datatable.GetSheet("Global").GetParameter("A").ValueByRow(2)
'"First"
Case3b=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 Test->Settings->Run->Run one iteration only 这样设置循环只能循环一次,就不能通过SetTOProperty参数化了,是不是调用Global中的数据就会再次循环datatable啊 配合Exit For、Exit Action这些语句来做
页:
[1]