判断Flight订票是否成功,求助
本帖最后由 lalaine520 于 2012-3-27 17:12 编辑通过订票系统,成功后Insert Order按钮会置灰,判断订票成功,否则不成功
代码如下:Dim Insert_Done_Exist
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Password:").SetSecure "4f717d499e1525f1fe87b11e1db904b91638b7e1"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "tom"
Window("Flight Reservation").WinButton("Insert Order").Click
Insert_Done_Exist=Window("Flight Reservation").WinObject("Insert Order").Exist
IfInsert_Done_Exist=true Then
reporter.ReportEvent micPass,"order success","According to the fact,it has really successed"
else
reporter.ReportEvent micFail,"order fail","According to the fact,it has really failure"
End If
Window("Flight Reservation").WinButton("Insert Order").Check CheckPoint("Insert Order")但是运行之中报错:
The "Insert Order" WinObject object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.
Line (13): "Insert_Done_Exist=Window("Flight Reservation").WinObject("Insert Order").Exist".
现求助大家,指点迷津,谢谢~ 很明显找不到对象啊
13行
Insert_Done_Exist=Window("Flight Reservation").WinObject("Insert Order").Exist
应该是
Insert_Done_Exist=Window("Flight Reservation").WinButton("Insert Order").Exist 很明显找不到对象啊
13行
Insert_Done_Exist=Window("Flight Reservation").WinObject("Insert Order"). ...
mimmy 发表于 2012-3-27 18:40 http://bbs.51testing.com/images/common/back.gif
多谢多谢~~~一开始试WINBUTTON没有“.exist”属性,经指点成功了 ,谢谢! 在对象库中把对象重新捕捉,添加以下,代码写的时候注意父级之间的关系 回复 4# xiaobai1gpp2
谢谢~~~已经成功了~~ 查询数据库 查询数据库
luchao215225 发表于 2012-3-29 17:16 http://bbs.51testing.com/images/common/back.gif
对了 这个FLIGHT的数据库怎么看呢
页:
[1]