|
刚开始接触QTP,根据视频教程设置自带的订票系统中Flight_table为Random number,运行怎么都提示如下错误:
Cannot identify the specified item of the From object. Confirm that the specified item is included in the object's item collection.
Line (6): "Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select RandomNumber("table"),, RandomNumber("p_Offset")".
代码是:
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type "121214"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("fly_from", dtGlobalSheet)
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("fly_to", dtGlobalSheet)
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select RandomNumber("table"),, RandomNumber("p_Offset")
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "tom"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("Button_2").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Customer Name").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "tom"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").Dialog("Search Results").WinList("Flight No.").Select RandomNumber("FlightNO")
Window("Flight Reservation").Dialog("Open Order").Dialog("Search Results").WinButton("OK").Click |
|