'启动飞机订票系统
Sub flight()
SystemUtil.Run "D:Program FilesMercury InteractiveQuickTest Professionalsamplesflightappflight4a.exe","","D:Program FilesMercury InteractiveQuickTest Professionalsamplesflightapp","open"
End Sub
'登录
Sub login()
Dialog("Login").WinEdit("Agent Name:").Set "cff100"
Dialog("Login").WinEdit("Password:").SetSecure "48dda077c740a7e3a91bdb8caff1f6fae5f02d1b"
Dialog("Login").WinButton("OK").Click
End Sub
'插入订单
Function insertorder()
Window("Flight Reservation").ActiveX("MaskEdBox").Type "111111"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Paris"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "12538 LON 10:24 AM PAR 12:24 PM AF $162.40" 可以以数值代替如2
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "cff100"
Window("Flight Reservation").WinRadioButton("Business").Set
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").ActiveX("Threed Panel Control").WaitProperty "text", Insert Done..., 10000
End Function
'退出
Sub logout()
Window("Flight Reservation").Close
End Sub
1. 调用SUB/FUNCTION方法是一样的……除了CALL调用如果有参数则需要使用括号将参数变量括起来。
2. SUB与FUNCTION的区别:SUB过程是没有返回值的.但是FUNCTION是可以有返回值的。