|
代码如下:
Dim sheetname, i, rowcount
sheetname = datatable.GetSheet(dtlocalsheet).Name
datatable.ImportSheet "E:\TEST\Excel.xls", "Sheet1", sheetname
rowcount = datatable.GetSheet(dtlocalsheet).GetRowCount
i = 0
Do until i>rowcount
i = i+1
datatable.GetSheet("Action1").SetCurrentRow(i)
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("userName").Set datatable("Login", dtlocalsheet)
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").WebEdit("password").Set datatable("Pwd", dtlocalsheet)
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").VirtualButton("login_button").Click
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select datatable("FromPort", dtlocalsheet)
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 7,10
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").WebRadioGroup("outFlight").Select "Blue Skies Airlines$361$271$7:10"
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 32,11
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "f1"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "f2"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("creditnumber").Set "1000"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebList("pass.0.meal").Select datatable("Meal", dtlocalsheet)
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 6,15
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("Logout").Click
Loop
脚本运行完毕后,出现错误提示框:“Cannot identify the object "fromPort"(of class WebList). Verify that this object's properties match an object currently displayed in your application”
在比较object仓库与runtime object 属性值后,未发现明显的区别?;"fromPort"对象的继承关系class等属性也是一致的,不知道问题出在哪里了,劳烦知道的同学,传授下经验! |
|