根据update order按钮判断订票成功时回放出现问题求解释
Window("Flight Reservation").ActivateWindow("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "123112"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurt"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "15889 DEN 03:12 PM FRA 03:57 PM AA $104.10"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "tianyanqin"
Window("Flight Reservation").WinEdit("Tickets:").SetSelection 0,1
Window("Flight Reservation").WinEdit("Tickets:").Set "2"
Window("Flight Reservation").WinRadioButton("First").Set
Window("Flight Reservation").WinButton("Insert Order").Click
Dim Update_Order_Enable
Update_Order_Enable=Window("Flight Reservation").WinButton("Update Order").GetROProperty("enabled")
If Update_Order_Enable=true Then
Reporter.ReportEvent micPass
Else
Reporter.ReportEvent micFail(出现error求解释)
End If 因为Window("Flight Reservation").WinButton("Insert Order").Click,执行这个的时候需要一段时间,只有这个执行完,update order 按钮才会变成true,出现这种情况: Reporter.ReportEvent micFail(出现error求解释),就是因为Window("Flight Reservation").WinButton("Insert Order").Click还没执行完毕,脚本已经跑完了 回复 2# yidao8808 我那是if else语句,但是他报的是参数问题,而且我又试了几下,结果是脚本后跑完,还是报参数问题,请帮我修改一下看看到底是什么原因??? 本帖最后由 yidao8808 于 2011-9-13 13:46 编辑
msgbox Update_Order_Enable
If Update_Order_Enable=true Then
Reporter.ReportEvent micPass, "导入票号", "导入成功"
Else
Reporter.ReportEvent micFail, "导入票号", "导入失败"
End If
参数不对,Reporter.ReportEvent micFail后面还有两个参数,reportstepname(名称),details(详细描述)
你这样写,运行基本上是会执行Reporter.ReportEvent micFail, "导入票号", "导入失败"这句,因为就像我前面说的,msgbox Update_Order_Enable,基本都是false Dim Update_Order_Enable
Update_Order_Enable=Window("Flight Reservation").WinButton("Update Order").WaitProperty("enabled",true,10000)
If Update_Order_Enable=true Then
Reporter.ReportEvent micPass, "导入票号", "导入成功"
Else
Reporter.ReportEvent micFail, "导入票号", "导入失败"
End If
这样写,Window("Flight Reservation").WinButton("Update Order").WaitProperty("enabled",true,10000),最多给她10秒时间去检查enabled属性,
页:
[1]