gegewu2009 发表于 2009-8-22 16:33:55

QTP Tutorial 中的订票操作参数化后无法运行第二行

qtp运行脚本如下:
Dialog("Login").Check CheckPoint("Login")
Dialog("Login").Activate        ' 打开登录界面
RunAction "Action_help", oneIteration
Dialog("Login").WinButton("Help").Click
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
Dialog("Login").WinButton("Help").Click
Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
Reporter.ReportEvent micDone, "login", "开始登陆操作"
Dialog("Login").WinEdit("Agent Name:").Set "MERCURY"        ' 输入代理机构名
Dialog("Login").WinEdit("Agent Name:").TypemicTab        ' 输入光标切换到密码列
Dialog("Login").WinEdit("Agent Name:").Output CheckPoint("Agent Name:")
Dialog("Login").WinEdit("Password:").Output CheckPoint("Password:_2")
Dialog("Login").WinEdit("Password:").SetSecure "4a8e02d7e1853f24cca1cdf02380c10784b4362e"        ' 输入登录密码
Dialog("Login").WinButton("OK").Click
Reporter.ReportEvent micDone, "login", "完成登录操作"
Window("Flight Reservation").ActiveX("MaskEdBox").Type DataTable("Fly_data", dtGlobalSheet)
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").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "LCL"
Window("Flight Reservation").Static("Tickets:").Click
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").Close

过程中参数化了Fly_from ,Fly_to,Fly_data, 在data table表中输入了两行参数,运行后第一行可以正常运行,第二行参数无法运行,提示信息如下:

Cannot identify the object "Login" (of class Dialog). Verify that this object's properties match an object currently displayed in your application.

Line (1): "Dialog("Login").Check CheckPoint("Login")".

Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.

不知道怎么回事啊,为什么运行第二行的时候不能识别login对话框呢,希望高手帮忙解释解决下,谢了

gegewu2009 发表于 2009-8-31 18:34:34

怎么都没人回答?

雪景 发表于 2013-7-24 15:42:37

我也遇到这个问题啦
页: [1]
查看完整版本: QTP Tutorial 中的订票操作参数化后无法运行第二行