TA的每日心情 | 开心 2016-2-27 08:48 |
---|
签到天数: 2 天 连续签到: 1 天 [LV.1]测试小兵
|
Description:
根据 QTP_Tutorial 里面的步骤介绍,先录制预定从 New York 到 San Francisco 航班的机票的操作,然后增加检查点 Checkpoint,最后对fromPort 进行参数化。最后的脚本如下:
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").Set "mercury"
Rem 为了说明问题,上面一行是我对原来录制的脚本修改后的结果。如果是录制的脚本,上面一行应为
Rem Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "... "
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 21,2
Wait(5)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select DataTable("depatture", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromMonth").Select "December"
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("toMonth").Select "December"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "31"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select "Business"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 65,7
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 77,10
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebTable("New York to San Francisco").Check CheckPoint("New York to San Francisco")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Check CheckPoint("Book a Flight: Mercury")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "Demie"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Check CheckPoint("passFirst0")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "Sun"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "8888888888888888"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 35,3
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Check CheckPoint("New York")
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("home").Click
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours_2").Sync
[ 本帖最后由 walker1020 于 2007-11-22 23:28 编辑 ] |
|