script.mts
来自「QTP实例源码(完整)」· MTS 代码 · 共 793 行 · 第 1/5 页
MTS
793 行
End If
If Browser("Accela Automation:_12").Page("Accela Automation:").Link("Comments").Exist Then
Call objTestLib.printfile(file,4)
Else
Call objTestLib.printfile(file,5,"Cannot find comments link!")
End If
'=====4. Application Detail
Call objTestLib.printfile(file,3," 4. Application Details")
objmsgbox.SQAMsgbox "4. Application Details","AA Auto Test",3,0
Browser("Accela Automation:_12").Page("Accela Automation:").Link("Detail").Click
arrExpectValue = Array("","$250,000.00","","1","1","N","101")
Call VerifyDetail(arrExpectValue)
Function VerifyDetail (arrExpectValue)
Dim intFlag,arrValue(6)
intFlag = 1
For intRowCount = 1 To 11 Step 2
arrValue(int(intRowCount/2)+1) = trim(Browser("Accela Automation:_13").Page("Accela Automation:").WebTable("Job Value:").GetCellData(intRowCount,2))
If arrValue(int(intRowCount/2)+1)<>arrExpectValue(int(intRowCount/2)+1) Then
intFlag = 0
Exit For
End If
Next
If intFlag=1 Then
Call objTestLib.printfile(file,4)
Else
Call objTestLib.printfile(file,5,"Details information displayed incorrectly!")
End If
End Function
'Browser("Accela Automation:_12").Page("Accela Automation:").Image("tab_menu").Click
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
'=====5. Assess Fees
Call objTestLib.printfile(file,3," 5. Assess Fees")
objmsgbox.SQAMsgbox "5. Assess Fees","AA Auto Test",3,0
Browser("Accela Automation:").Page("Accela Automation:").Link("Assess Fees").Click @@ script infofile_;_ZIP::Assess_Fees_ssf52.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:").Link("Assess Fees")_;_NFB_;_720995_;_
Call AddTwoFees()
If Err_Flag=False Then
Call DeleteFee()
Call InvoiceFee()
End If
Call ChangeAppNo()
Call ChangeCalFactor()
Function AddTwoFees ()
Err_Flag = True
'a.Add two fee items
Call objTestLib.printfile(file,3," a. Add two fee items")
Browser("Accela Automation:_17").Page("Accela Automation:").Image("Add new Fee").Click @@ script infofile_;_ZIP::Add_new_Fee_ssf53.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation:").Image("Add new Fee")_;_NFB_;_720996_;_
wait(5)
strFee = Trim(Browser("Accela Automation:_42").Page("Accela Automation:").WebTable("Fee Calculator").GetCellData(4,3))
Browser("Accela Automation:_42").Page("Accela Automation:").WebEdit("feeUnitName1").Set "1"
Browser("Accela Automation:_42").Page("Accela Automation:").WebEdit("feeUnitName2").Set "1" @@ script infofile_;_ZIP::feeUnitName2_ssf239.inf_;_hightlight id_;_Browser("Accela Automation: 42").Page("Accela Automation:").WebEdit("feeUnitName2")_;_NFB_;_1751347_;_
Browser("Accela Automation:_42").Page("Accela Automation:").Image("Submit").Click 12,10 @@ script infofile_;_ZIP::Submit_ssf240.inf_;_hightlight id_;_Browser("Accela Automation: 42").Page("Accela Automation:").Image("Submit")_;_NFB_;_1751347_;_
'strFee = Trim(Browser("Browser").Page("Page").WebTable("Fee Calculator").GetCellData(4,3))
'Browser("Browser").Page("Page").WebEdit("feeUnitName1").Set "1" @@ script infofile_;_ZIP::feeUnitName1_ssf54.inf_;_hightlight id_;_Browser("Browser").Page("Page").WebEdit("feeUnitName1")_;_NFB_;_730997_;_
'Browser("Browser").Page("Page").WebEdit("feeUnitName2").Set "1" @@ script infofile_;_ZIP::feeUnitName2_ssf55.inf_;_hightlight id_;_Browser("Browser").Page("Page").WebEdit("feeUnitName2")_;_NFB_;_730997_;_
'Browser("Browser").Page("Page").Image("Submit").Click 24,10 @@ script infofile_;_ZIP::Submit_ssf56.inf_;_hightlight id_;_Browser("Browser").Page("Page").Image("Submit")_;_NFB_;_730997_;_
wait(10)
If Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Exist Then
Browser("Accela Automation:_17").Page("Accela Automation:").Link("FeeItem").SetTOProperty "text",strFee
If Browser("Accela Automation:_17").Page("Accela Automation:").Link("FeeItem").Exist Then
Err_Flag = False
Call objTestLib.printfile(file,4)
Else
Call objTestLib.printfile(file,5,"Adding a fee failed!")
End If
' Elseif Browser("Browser").Dialog("Microsoft Internet").WinButton("OK").Exist Then
' strMessage= Browser("Browser").Dialog("Microsoft Internet").Static("Warnning").GetROProperty("text")
' Browser("Browser").Dialog("Microsoft Internet").WinButton("OK").Click
' Call objTestLib.printfile(file,5,"updated the Contact failed, the error message is " & strMessage)
Else
Call objTestLib.printfile(file,5,"there occurs an unexpected error!")
Browser("Accela Automation:").back
End If
End Function
Function DeleteFee ()
'b. Delete a fee
Call objTestLib.printfile(file,3," b. Delete a fee")
Browser("Accela Automation:_17").Page("Accela Automation:").Image("Delete Fee Item").Click @@ script infofile_;_ZIP::Delete_Fee_Item_ssf57.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation:").Image("Delete Fee Item")_;_NFB_;_740999_;_
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click
wait(10)
If Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Exist Then
Call objTestLib.printfile(file,4)
Elseif Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Exist Then
strMessage = Browser("Accela Automation:_17").Dialog("Microsoft Internet").Static("Warnning").GetROProperty("text")
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click
Call objTestLib.printfile(file,5,"delete fee failed, the error message is " & strMessage)
Else
Call objTestLib.printfile(file,5,"there occurs an unexpected error!")
Browser("Accela Automation:").back
End If
End Function
Function InvoiceFee ()
'c. make invoice for new app
Call objTestLib.printfile(file,3," c. make invoice for new app")
Browser("Accela Automation:_17").Page("Accela Automation:_6").WebCheckBox("chkall").Set "ON" @@ script infofile_;_ZIP::chkall_ssf68.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 6").WebCheckBox("chkall")_;_NFB_;_751009_;_
Browser("Accela Automation:_17").Page("Accela Automation:_6").Image("Invoice Fee").Click @@ script infofile_;_ZIP::Invoice_Fee_ssf69.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 6").Image("Invoice Fee")_;_NFB_;_751009_;_
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click @@ script infofile_;_ZIP::Microsoft_Internet_Explorer_ssf70.inf_;_hightlight id_;_2_;_
If Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Exist(5) Then
Call objTestLib.printfile(file,4)
Elseif Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Exist Then
strMessage = Browser("Accela Automation:_17").Dialog("Microsoft Internet").Static("Warnning").GetROProperty("text")
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click
Call objTestLib.printfile(file,5,"invoice fee failed, the error message is " & strMessage)
Else
Call objTestLib.printfile(file,5,"there occurs an unexpected error!")
Browser("Accela Automation:").back
End If
End Function
Function ChangeAppNo ()
'd. Change the application number and back
Call objTestLib.printfile(file,3," d. Change the application number and back")
Browser("Accela Automation:_17").Page("Accela Automation:_3").WebEdit("PerID3").Set String(5-len(int(strAppNumber3)-1),"0") & int(strAppNumber3)-1 @@ script infofile_;_ZIP::PerID3_ssf60.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 3").WebEdit("PerID3")_;_NFB_;_751002_;_
Browser("Accela Automation:_17").Page("Accela Automation:_3").Image("Submit").Click @@ script infofile_;_ZIP::Submit_ssf61.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 3").Image("Submit")_;_NFB_;_751002_;_
If Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Exist(5) Then
Call objTestLib.printfile(file,4)
Elseif Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Exist Then
strMessage = Browser("Accela Automation:_17").Dialog("Microsoft Internet").Static("Warnning").GetROProperty("text")
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click
Call objTestLib.printfile(file,5,"Change application number failed, the error message is " & strMessage)
Else
Call objTestLib.printfile(file,5,"there occurs an unexpected error!")
Browser("Accela Automation:").back
End If
Browser("Accela Automation:_17").Page("Accela Automation:_4").WebEdit("PerID3").Set strAppNumber3 @@ script infofile_;_ZIP::PerID3_ssf62.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 4").WebEdit("PerID3")_;_NFB_;_751003_;_
Browser("Accela Automation:_17").Page("Accela Automation:_4").Image("Submit").Click @@ script infofile_;_ZIP::Submit_ssf63.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 4").Image("Submit")_;_NFB_;_751003_;_
wait(5)
End Function
Function ChangeCalFactor ()
'e. change the Fee calculation factior to contractor and calculator
Call objTestLib.printfile(file,3," e. change the Fee calculation factior to contractor and calculator")
Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Select "CALC" @@ script infofile_;_ZIP::feeCalcFactor_ssf64.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 3").WebRadioGroup("feeCalcFactor")_;_NFB_;_751004_;_
wait(5)
Browser("Accela Automation:_17").Page("Accela Automation:_5").WebRadioGroup("feeCalcFactor").Select "CONT" @@ script infofile_;_ZIP::feeCalcFactor_ssf65.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 5").WebRadioGroup("feeCalcFactor")_;_NFB_;_751005_;_
If Browser("Accela Automation:_17").Page("Accela Automation:_3").WebRadioGroup("feeCalcFactor").Exist(5) Then
Call objTestLib.printfile(file,4)
Elseif Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Exist Then
strMessage = Browser("Accela Automation:_17").Dialog("Microsoft Internet").Static("Warnning").GetROProperty("text")
Browser("Accela Automation:_17").Dialog("Microsoft Internet").WinButton("OK").Click
Call objTestLib.printfile(file,5,"Change calculation factior failed, the error message is " & strMessage)
Else
Call objTestLib.printfile(file,5,"there occurs an unexpected error!")
Browser("Accela Automation:").back
End If
End Function
'Browser("Accela Automation:_17").Page("Accela Automation:_6").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf66.inf_;_hightlight id_;_Browser("Accela Automation: 17").Page("Accela Automation: 6").Image("tab menu")_;_NFB_;_751006_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click @@ script infofile_;_ZIP::Accela_Automation__ssf67.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:")_;_NFB_;_751007_;_
'=====6. Cahier payment
Call objTestLib.printfile(file,3," 6. Cahier payment")
objmsgbox.SQAMsgbox "6. Cahier payment","AA Auto Test",3,0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?