UFT (自定义检查点——票数*价格是否等于总数)

来源:互联网 发布:邢台网络优化招聘 编辑:程序博客网 时间:2024/05/23 12:03
 Dim a,b,c,d,e
a = Window("Flight Reservation").WinEdit("Tickets:").GetROProperty("text")
msgbox a
b= Window("Flight Reservation").WinEdit("Price:").GetROProperty("text")
msgbox b
c=split(b,"$")
msgbox c(1)
d=Window("Flight Reservation").WinEdit("Total:").GetROProperty("text")
e=split(d,"$")
msgbox e(1)
x=cdbl(a)
y=cdbl(c(1))
z=cdbl(e(1))
If z-x*y<0.001 Then
reporter.ReportEvent micPass,"检查Price*Ticket的价格是否等于Total","正确"
Else
reporter.ReportEvent micFail,"检查Price*Ticket的价格是否等于Total","错误"
msgbox"错误"
End If 
0 0