|
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","","C:\Documents and Settings\Administrator","open"
Browser("name:=百度一下,你就知道").Page("title:=百度一下,你就知道").Sync
Browser("name:=百度一下,你就知道").Navigate "http://newtours.demoaut.com/"
Browser("name:=Welcome: Mercury Tours").Page("title:=Welcome: Mercury Tours").WebEdit("name:=userName").Set "test"
Browser("name:=Welcome: Mercury Tours").Page("title:=Welcome: Mercury Tours").WebEdit("name:=password").SetSecure "4909303a5aed4e94add116751070aa5284ad"
Browser("name:=Welcome: Mercury Tours").Page("title:=Welcome: Mercury Tours").Image("alt:=Sign-In").Click 0,2
Browser("Find a Flight: Mercury").Page("Find a Flight: Mercury").Image("findFlights").Click 61,10
Browser("Find a Flight: Mercury").Page("Select a Flight: Mercury").Image("reserveFlights").Click 77,10
Browser("Find a Flight: Mercury").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "qing"
Browser("Find a Flight: Mercury").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "li"
Browser("Find a Flight: Mercury").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "1"
DataTable.ImportSheet "E:\资料\QTP PPT\Example\Cycle\Data.xls","Sheet1","Global"
Dim dtvalue,dtsheet
Set dtsheet=DataTable.GetSheet("Global")
For i=0 to dtsheet.GetRowCount
dtvalue=DataTable.Value("SelectItem","Global")
Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").WebList("billCountry").Select dtvalue
dtsheet.setnextrow
Next
DataTable.ImportSheet "E:\资料\QTP PPT\Example\Cycle\Data.xls","Sheet2","Global"
Browser("Find a Flight: Mercury").Page("Book a Flight: Mercury").Image("buyFlights").Click 64,10
在Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").WebList("billCountry").Select dtvalue
这句总出现错误,如图是怎么回事?
没找出原因,请帮我看下,billCountry控件已经在对象库中了 |
|