51Testing软件测试论坛
标题:
QTP问题,高手帮忙下
[打印本页]
作者:
poorcolor
时间:
2009-6-19 14:18
标题:
QTP问题,高手帮忙下
脚本:
SystemUtil.Run "D:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","D:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set DataTable("username", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").SetSecure "4a3ae16ff4c8d82b1b253b1d0ef54d1019048781"
Dialog("Login").Activate
Dim x
x=Dialog("Login").WinEdit("Agent Name:").GetROProperty("text")
If x="wish01" Then
Window("Flight Reservation").Close
else
Dialog("Login").WinButton("OK").Check CheckPoint("aser")
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("start", dtGlobalSheet)
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("end", dtGlobalSheet)
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Activate RandomNumber(0, 2)
Window("Flight Reservation").WinEdit("Name:").Type "T"
Window("Flight Reservation").WinEdit("Name:").Set "Tim"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").Close
End If
运行到If x="wish01" Then
Window("Flight Reservation").Close出错,怎么让她运行到这里的时候点cancel那个按钮呢?
作者:
poorcolor
时间:
2009-6-19 14:20
标题:
11
username start end
wish03 Portland Zurich
wish01 Frankfurt London
wish02 London Portland
作者:
poorcolor
时间:
2009-6-19 14:23
标题:
11
好像是这句:Dialog("Login").WinButton("regexpwndtitle:=Cancel").Click
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2