|
各位大大,下面的代码跑不通,总会报错,帮藕看看?(mercury的示例网站上http://newtours.mercuryinteractive.com/tour,设置passanger的数量为(1-4)任意一个数字时,在book a flight界面上输入的人名数量相应改变)不知道哪里出问题了,多谢各位大大!
Dim n
Randomize
=Int((4* Rnd) + 1)
Sub setName()
counter=0
For i = 0 to n
Browser("opentitle:=Welcome: Mercury Tours").Page("title:=Book a Flight: ").WebEdit("name:=passFirst&i").Set "AA2"
Browser("opentitle:=Welcome: Mercury Tours").Page("title:=Book a Flight: ").WebEdit("name:=passLast&i").Set "BB"
counter = counter + 1
Next
End Sub
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours_2").WebEdit("userName").Set "pitera"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours_2").WebEdit("password").SetSecure "4716fe482f57fe9d294b0d080929b4badd3144f326ec"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours_2").Image("Sign-In").Click 12,2
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").WebList("passCount").SetTOProperty"selection",n 'n=2
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury_2").Image("findFlights").Click 16,10
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury_2").Image("reserveFlights").Click 40,4
Call setName()
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury_2").WebEdit("creditnumber").Set "123"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury_2").Image("buyFlights").Click 47,7
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury_2").Image("home").Click
[ 本帖最后由 pitera 于 2007-10-18 15:49 编辑 ] |
|