|
本人是QTP初学者,还请大家一定要帮忙,用QTP自带的订票系统录制脚本如下
Window("Flight Reservation").WinObject("Date of Flight:").Type "090909"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("from", dtGlobalSheet)
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("to", dtGlobalSheet)
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select RandomNumber(0, 100)
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set Environment("user1")
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("Button_2").Click
Window("Flight Reservation").WinButton("Button").Click
Dim str
Set FlighsList= window("Flight Reservation").Dialog("Flights Table").WinList("From")
For i=1to FlighsList.GetItemsCount
str=str+FlightsList.GetItem(i-1)+vbCRLF
Next
msgbox str
执行到红色字体代码就会报错如下,为什么同样是一个对象,在执行蓝色字体代码时就没有报错。已经对比了 仓库中对象属性 和 程序中对象属性,没有什么差异。这类问题应该如何解决?
Can not find the"From"object parent “Flights Table”[class Dialog].Verify that parent propertities match an object currently displayed in your application. |
|