|
录制之后的脚本可以成功运行,插入检查点之后再运行脚本时,运行一半就停止了,然后自动退出qtp程序,脚本如下:
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "48dce1b9cee3efe426e8b8b60c7e95aecc0e"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 26,4
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "New York"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "San Francisco"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "hyl_107"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "28"
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 56,12
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("inFlight").Select "Blue Skies Airlines$631$273$14:30"
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 25,8
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 "h"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Check CheckPoint("passFirst0_2")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "yl"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "8888888888888888"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebCheckBox("ticketLess").Set "ON"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 82,8
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
运行到
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "h"
时退出程序 |
|