|
'练习录制QTP自带的订票系统
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").WebEdit("userName").Set "lingling"
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").WebEdit("password").SetSecure "48896cdbe61c615b6805807a225f49bd003c9997b4b8"
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").Image("Sign-In").Click 29,11
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebList("fromPort").Select DataTable("departrue", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").JavaApplet("showCalendar").JavaButton("View Calendar").Click
JavaWindow("Select Departure Date").JavaList("Month:").Select "August"
JavaWindow("Select Departure Date").JavaList("Year:").Select "2008"
'手工增加,激活Select Departure Date窗口然后触发按钮事件,同时在本地库中手工增加JavaButton("8")
JavaWindow("Select Departure Date").Activate
JavaWindow("Select Departure Date").JavaButton("8").Click
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").JavaApplet("showCalendar_2").JavaButton("View Calendar").Click
JavaWindow("Select Arrivale Date").JavaList("Month:").Select "September"
JavaWindow("Select Arrivale Date").JavaList("Year:").Select "2008"
'手工增加,激活Select Arrivale Date窗口然后触发按钮事件
JavaWindow("Select Arrivale Date").Activate
JavaWindow("Select Arrivale Date").JavaButton("10").Click
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebRadioGroup("servClass").Select "Business"
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").Image("findFlights").Click 51,17
Browser("Welcome: Mercury Tours_2").Page("Select a Flight: Mercury").Image("reserveFlights").Click 56,15
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "lingling"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "hou"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "88888"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").Image("buyFlights").Click 70,7
Browser("Welcome: Mercury Tours_2").Page("Flight Confirmation: Mercury").Image("home").Click
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours").Link("SIGN-OFF").Click
'在本地对象库中通过复制增加Select Arrivale Date下的所有对象
'注意:录制的脚本对象必须与复制增加的对象的属性一致,否则识别不了
'练习录制QTP自带的订票系统
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").WebEdit("userName").Set "lingling"
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").WebEdit("password").SetSecure "48896cdbe61c615b6805807a225f49bd003c9997b4b8"
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours_2").Image("Sign-In").Click 29,11
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebList("fromPort").Select DataTable("departrue", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").JavaApplet("showCalendar").JavaButton("View Calendar").Click
JavaWindow("Select Departure Date").JavaList("Month:").Select "August"
JavaWindow("Select Departure Date").JavaList("Year:").Select "2008"
'手工增加,激活Select Departure Date窗口然后触发按钮事件,同时在本地库中手工增加JavaButton("8")
JavaWindow("Select Departure Date").Activate
JavaWindow("Select Departure Date").JavaButton("8").Click
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").JavaApplet("showCalendar_2").JavaButton("View Calendar").Click
JavaWindow("Select Arrivale Date").JavaList("Month:").Select "September"
JavaWindow("Select Arrivale Date").JavaList("Year:").Select "2008"
'手工增加,激活Select Arrivale Date窗口然后触发按钮事件
JavaWindow("Select Arrivale Date").Activate
JavaWindow("Select Arrivale Date").JavaButton("10").Click
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").WebRadioGroup("servClass").Select "Business"
Browser("Welcome: Mercury Tours_2").Page("Find a Flight: Mercury_2").Image("findFlights").Click 51,17
Browser("Welcome: Mercury Tours_2").Page("Select a Flight: Mercury").Image("reserveFlights").Click 56,15
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "lingling"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "hou"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "88888"
Browser("Welcome: Mercury Tours_2").Page("Book a Flight: Mercury").Image("buyFlights").Click 70,7
'对文本检查点进行参数化,引用前面航班起始地的参数化列表
Browser("Welcome: Mercury Tours_2").Page("Flight Confirmation: Mercury_2").Check CheckPoint("Flight Confirmation: Mercury_5")
Browser("Welcome: Mercury Tours_2").Page("Flight Confirmation: Mercury").Image("home").Click
Browser("Welcome: Mercury Tours_2").Page("Welcome: Mercury Tours").Link("SIGN-OFF").Click
为什么在RESULT中查看回放时所有参数化都没问题,但是第2次第3次参数化的文本检查点就总是报错etails
Text Checkpoint: captured "" between Departing and to San Francisco 8/ , expected "ortland"
Match case: OFF
Exact match: OFF
Ignore spaces: ON。
为什么抓不到 " Portland",只抓得到“”
[ 本帖最后由 jacksboy 于 2008-7-30 20:06 编辑 ] |
|