QTP 设置完Random nmber后怎么都运行不过去,求助,帮忙看看为什么。谢谢!
刚开始接触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 额。。。没人帮忙看看么? 回复 2# qiqi744
翻译过来就是无法识别指定的项的对象。确定指定的项目中包含的对象的项集合。
就是说你要选的选项,你的列表里没有。 我也在学QTP。如果要生成随机数,可以用Randomize. 不知道你有没有解决这个问题,我也是刚接触QTP,按照视频讲的操作就报这个错误,如果解决了还希望分享下:)
页:
[1]