51Testing软件测试论坛

标题: 怎么找到这个值? [打印本页]

作者: C060706    时间: 2007-9-20 16:49
标题: 怎么找到这个值?
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "46f22d66248f934d1e6cfe8496d25e15e55ada9e"
Dialog("Login").WinEdit("Password:").Type  micReturn
Window("Flight Reservation").WinObject("Date of Flight:").Type "092107"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Denver"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Activate "20288   LON   08:12 AM   SEA   03:23 PM   AA     $112.20"
Window("Flight Reservation").WinEdit("Name:").Set "test"
Window("Flight Reservation").WinButton("Insert Order").Click
wait 7
Num = Window("Flight Reservation").WinEdit("Order No:").GetROProperty("Text")
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Close

我用了红色的那语句,那我该怎么找到,我取得的值!
望详解。。。
作者: 小孩    时间: 2007-9-20 20:01
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "admin"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "46f25c0c4be6951a9c2628956475"
Dialog("Login").WinEdit("Password:").SetSecure "46f25c0e3d0af362190ae1b6f6e058e59b08c6eb"
Dialog("Login").WinEdit("Password:").Type  micReturn
Window("Flight Reservation").ActiveX("MaskEdBox").Type "111111"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Denver"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "111"
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
'这个是一个同步点效果比你价格wait 7 好多了!
Dim num '定义一个变量
num=Window("Flight Reservation").WinEdit ("Order No:").GetROProperty("text")
‘把WinEdit ("Order No:")中text的值赋于num
msgbox num '这个是用来调试用的 可以不要
Window("Flight Reservation").Close
作者: C060706    时间: 2007-9-21 10:30
原帖由 小孩 于 2007-9-20 20:01 发表
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\"," ...



我运行了:Window("Flight Reservation").WinButton("Insert Order").Click
               Window("Flight Reservation").ActiveX("Threed Panel Control").WaitProperty "text", "Insert Done... ", 10000

错误如下:
作者: C060706    时间: 2007-9-21 10:39
经过我自己的修改,我又跑通了!我修改了其中的一点!
但,还是想请兄台给点关于同步点的资料,谢谢!
作者: hdice    时间: 2007-9-21 11:00
我录制的代码如下
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Password:").SetSecure "46f32ab6289e626951c85bab1d1ea85c3a502bae"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type "010909"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "13536   FRA   08:00 AM   LON   08:45 AM   SR     $163.00"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "d"
Window("Flight Reservation").WinButton("Insert Order").Click

Window("Flight Reservation").WinObject("AfxWnd40").WaitProperty "text", "Insert Done...", 10000
Dim x
x=Window("Flight Reservation").WinEdit ("Order No:").GetROProperty ("text")
print x
Window("Flight Reservation").Close

就是这句我怎么录下来的是“AfxWnd40”,想问一下“Threed Panel Control”这个是怎么录下来的呢?
Window("Flight Reservation").WinObject("AfxWnd40").WaitProperty "text", "Insert Done...", 10000
[attach]33078[/attach]

[ 本帖最后由 hdice 于 2007-9-21 11:03 编辑 ]
作者: C060706    时间: 2007-9-21 13:52
不清楚哦,我是把它给换了的,换成我的Object Repository中存在的,而他写的那个,我的Object Repository 中根本不存在!

我换了之后就调通了!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2