QTP中自帶的飛機訂票系統的自動(dòng)化測試腳本
測試實(shí)現
1.登錄名,訂票日期的參數化
2.飛機的起始地,航班,票數的隨機選擇
3.對總票價(jià)與但票價(jià)的計算核對
4。頭等艙,商業(yè)艙價(jià)格是經(jīng)濟艙的倍數檢查
5.對所定的票進(jìn)行查詢(xún)
6.對定好的票號進(jìn)行檢查并輸出檢查內容
'登錄界面 的操作
Dialog("Login").WinEdit("Agent Name:").Set DataTable("Agent_Name", dtLocalSheet)
Dialog("Login").WinEdit("Password:").SetSecure "4d646f4218e27f097848718d8842bf6a65537f6d"
username= dialog("Login").WinEdit("Agent Name:").GetROProperty("text")
Dialog("Login").WinButton("OK").Click
'訂票界面的操作的
Window("Flight Reservation").WinObject("Date of Flight:").type DataTable("Data_of_Flight1", dtGlobalSheet) '日期的操作選擇
''''訂票的出發(fā)地的選擇
num1= Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
num1= num1-1
Window("Flight Reservation").WinComboBox("Fly From:").Select RandomNumber(0, num1)
'驗證flight的狀態(tài)
If window("Flight Reservation").WinButton("FLIGHT").GetROProperty("enabled") <> 0 Then
print "filght 出錯!現在處于激活狀態(tài)"
End If
'''''訂票的目的地的選擇
文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/