tickets= randomnumber(1,10)
Window("Flight Reservation").WinEdit("Tickets:").Set tickets
' 验证计算票价是否计算是否正确
price= Window("Flight Reservation").WinEdit("Price:").GetROProperty("text")
total= Window("Flight Reservation").WinEdit("Total:").GetROProperty("text")
total=mid(total,2,len(total)-1)
'print "total="& total
price=mid(price,2,len(price)-1)
'print "price="& price
tickets=cdbl(tickets)
total1 = price*tickets
'print total1
total1= cdbl(total1)
If total - total1 > 0.001 Then
print "票价计算出错"
End If
'验证票价的是否正确
If c=1 and( price - price1*3) >0.001 Then
print " 头等舱票价计算出错"
else if c=2 and (price - price1*2) >0.001 then
print "商业舱票价计算出错 "
end if
End If
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("Update Order").Click
'添加的检查点和检查点的输出!
Window("Flight Reservation").WinEdit("Order No:").Check CheckPoint("Order No:")
Window("Flight Reservation").WinEdit("Order No:").Output CheckPoint("Order No:_2")
no = window("Flight Reservation").WinEdit("Order No:").GetROProperty("text")
Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set no
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Close
wait(2)
文章来源于领测软件测试网 https://www.ltesting.net/