标题: 按照Dividing Tests into Multiple Actions录制脚本后运行出错 [打印本页] 作者: peng51818 时间: 2005-12-27 10:18 标题: 按照Dividing Tests into Multiple Actions录制脚本后运行出错 按照QuickTest Tutorial Help文档中的Dividing Tests into Multiple Actions 一章录制本脚本后,当没有参数化Copy of FlightOrder Action时,运行脚本成功;但是参数化Copy of FlightOrder Action后运行出错,出错信息:
Cannot find the "fromPort" object's parent "Welcome: Mercury Tours" (class Browser). Verify that parent properties match an object currently displayed in your application.
详细信息:
Line (1): "Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "London"".
请各位大侠帮忙解决,谢谢!作者: jun84826 时间: 2005-12-27 15:42
你把你的脚本发上来看看吧作者: 梦醒十分 时间: 2005-12-27 17:20
建议您增加以下几个值:
1:Test settings>Run>Obj syn time out 如=20000
2:Test settings>Web>Browser nav time out 如=60000
3:Options>Web>Load time 如=20作者: peng51818 时间: 2005-12-28 12:06
谢谢!!!
这是我录制的脚本:
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "New York"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select DataTable("fromDay", dtLocalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select DataTable("toDate", dtLocalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 46,8
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 71,3
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "peng"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "fr"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "88888888"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 61,7
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("backtoflights").Click
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Sync作者: peng51818 时间: 2005-12-28 12:07
谢谢!!!
这是我录制的脚本:
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "New York"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select DataTable("fromDay", dtLocalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select DataTable("toDate", dtLocalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 46,8
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 71,3
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "peng"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "fr"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "88888888"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 61,7
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("backtoflights").Click
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Sync作者: 梦醒十分 时间: 2005-12-28 17:01
行了吗?你怎么又参数化日期了而不是地点了?作者: peng51818 时间: 2005-12-29 13:15
谢谢你的帮助。
完整的脚本是:
-----登录脚本(Sign_in)
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "peng51818"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "43af8e2bb2b002592974453729764f207fa1b52fa08c"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 35,12
----订票脚本(FlightOrder)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "New York"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select "29"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "31"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 46,8
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 71,3
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "peng"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "fr"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "88888888"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 61,7
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("backtoflights").Click
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Sync
--返回首页脚本(ReturnHome)
' Return to page used in first step of the test.
Browser("Find a Flight: Mercury").Page("Find a Flight: Mercury").Link("Home").Click
Browser("Find a Flight: Mercury").Page("Welcome: Mercury Tours").Sync