sufen2315 发表于 2008-10-10 13:49:52

action循环问题

试图用代码实现多次循环插入机票定制,用for next
为什么以下的代码循环第一次可以成功,在第二次循环执行
Window("Flight Reservation").WinButton("Insert Order").Click
时出错了,提示:"Object is disabled
Line (18): "Window("Flight Reservation").WinButton("Insert Order").Click". "
请问什么原因如何解决?
Dim i
i=3
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "linsf"
Dialog("Login").WinEdit("Password:").SetSecure "48eeb3899c2b089a579e03eddee4c32cf1285892"
Dialog("Login").WinEdit("Password:").TypemicReturn

For i = 1 to 3

Window("Flight Reservation").WinObject("Date of Flight:").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").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "123123"
Window("Flight Reservation").WinEdit("Tickets:").SetSelection 0,1
Window("Flight Reservation").WinEdit("Tickets:").Set "4"
Window("Flight Reservation").WinButton("Insert Order").Click
next
Window("Flight Reservation").WinMenu("Menu").Select "Analysis;Graphs..."
Window("Flight Reservation").Dialog("Graph").Close
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

zhuyuancan 发表于 2008-10-11 17:19:08

不是太清楚,没有搞过这个例子!!!想着是不是重复订票造成的吧!!!试着把相关数据参数化一下下,再试试

蝶恋meng 发表于 2008-10-11 17:42:41

偶也不想灌水啊,多挣点票数要紧嘛。
页: [1]
查看完整版本: action循环问题