⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.mts

📁 QTP实例源码(完整)
💻 MTS
📖 第 1 页 / 共 5 页
字号:
	wait(5) @@ script infofile_;_ZIP::Accela_Automation__ssf247.inf_;_hightlight id_;_Browser("Accela Automation:_44").Page("Accela Automation:")_;_NFB_;_1931383_;_
	Browser("Accela Automation:_44").Close
	If Browser("Accela Automation:_24").Page("Accela Automation:").Image("TaskFlag").Exist(5) Then
        Call objTestLib.printfile(file,4)
	Else
		Call objTestLib.printfile(file,5,"cannot find a check mark near the first task!")
	End If
End Function

Function DeleteTask ()
	Browser("Accela Automation:").Page("Accela Automation:").Link("History").Click @@ script infofile_;_ZIP::History_ssf142.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:").Link("History")_;_NFB_;_921067_;_
	While Browser("Accela Automation:_23").Page("Accela Automation:").Image("Delete").Exist(5)
		 Browser("Accela Automation:_23").Page("Accela Automation:").Image("Delete").Click
		 Browser("Accela Automation:_23").Dialog("Microsoft Internet").WinButton("OK").Click
		 wait(5)
	Wend
	If Browser("Accela Automation:_23").Page("Accela Automation:").Image("Delete").Exist=False Then
        Call objTestLib.printfile(file,4)
	Else
		Call objTestLib.printfile(file,5,"can find some tasks!")
	End If
End Function

'Browser("Accela Automation:_23").Page("Accela Automation:").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf147.inf_;_hightlight id_;_Browser("Accela Automation: 23").Page("Accela Automation:").Image("tab menu")_;_NFB_;_921070_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click

'=====8. Permit 
Call objTestLib.printfile(file,3,"   8. Permit")
objmsgbox.SQAMsgbox "8. Permit","AA Auto Test",3,0 @@ script infofile_;_ZIP::Accela_Automation__ssf148.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:")_;_NFB_;_921071_;_
Browser("Accela Automation:").Page("Accela Automation:").Link("App Summary").Click @@ script infofile_;_ZIP::App_Summary_ssf149.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:").Link("App Summary")_;_NFB_;_921072_;_
Browser("Accela Automation:_12").Page("Accela Automation:").Image("tab_non_permit").Click @@ script infofile_;_ZIP::tab_non_permit_ssf150.inf_;_hightlight id_;_Browser("Accela Automation: 12").Page("Accela Automation:").Image("tab non permit")_;_NFB_;_921073_;_
'Browser("Browser_5").Page("Page").Sync
If Browser("Browser_5").Page("Page").ActiveX("Adobe Acrobat").Exist(20) Then
   Call objTestLib.printfile(file,4)
Else
   Call objTestLib.printfile(file,5,"cannot find the generated report!")
End If
Do While Instr(Browser("index:=0").GetROProperty("Title"),"Accela Automation")=0 
  Browser("index:=0").close 
Loop 

'Browser("Accela Automation:_12").Page("Accela Automation:").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf152.inf_;_hightlight id_;_Browser("Accela Automation: 12").Page("Accela Automation:").Image("tab menu")_;_NFB_;_941076_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click

'=====9. Inspection
Call objTestLib.printfile(file,3,"   9. Inspection")
objmsgbox.SQAMsgbox "9. Inspection","AA Auto Test",3,0 @@ script infofile_;_ZIP::Accela_Automation__ssf153.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:")_;_NFB_;_941077_;_
Browser("Accela Automation:").Page("Accela Automation:").Link("Schedule").Click @@ script infofile_;_ZIP::Schedule_ssf154.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:").Link("Schedule")_;_NFB_;_941078_;_
'a.schedule two inspections
Call objTestLib.printfile(file,3,"        a.schedule two inspections")
Call ScheduleInspection()
If Err_Flag=False Then
   Call RescheduleInspection()
   Call CancelInspection()
End If
Call ScheduleInspection()
'Browser("Accela Automation:_28").Page("Accela Automation:_4").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf177.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 4").Image("tab menu")_;_NFB_;_961090_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
If Err_Flag=False Then
    Call AssignInspection()
End If
'Browser("Accela Automation:_31").Page("Accela Automation:_2").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf192.inf_;_hightlight id_;_Browser("Accela Automation: 31").Page("Accela Automation: 2").Image("tab menu")_;_NFB_;_1011099_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
Call SearchAllInsp()
'Browser("Accela Automation:_31").Page("Accela Automation:_2").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf192.inf_;_hightlight id_;_Browser("Accela Automation: 31").Page("Accela Automation: 2").Image("tab menu")_;_NFB_;_1011099_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
Call CheckHistroy()
'Browser("Accela Automation:_34").Page("Accela Automation:").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf210.inf_;_hightlight id_;_Browser("Accela Automation: 34").Page("Accela Automation:").Image("tab menu")_;_NFB_;_1051115_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
Call CheckRouteSheet()
'Browser("Accela Automation:_40").Page("Accela Automation:_2").Image("tab_menu").Click @@ script infofile_;_ZIP::tab_menu_ssf218.inf_;_hightlight id_;_Browser("Accela Automation: 40").Page("Accela Automation: 2").Image("tab menu")_;_NFB_;_1071121_;_
Browser("Accela Automation:").Page("Accela Automation:").Image("tab_menu").Click
Call InspSupervisor()

Function ScheduleInspection ()
	Err_Flag = True
	wait(5)
	Set oDesc = Description.Create() 
	oDesc("micclass").Value = "WebCheckBox"
	Set WebCheckBoxs = Browser("Accela Automation:_28").Page("Accela Automation:").ChildObjects(oDesc)
	strEditValue = WebCheckBoxs(0).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:").WebCheckBox("Insp180081").SetTOProperty "name",strEditValue
	strEditValue = WebCheckBoxs(1).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:").WebCheckBox("Insp180082").SetTOProperty "name",strEditValue
	strInspName1 = Browser("Accela Automation:_28").Page("Accela Automation:").WebTable("Required Inspections").GetCellData(4,2)
	strInspName2 = Browser("Accela Automation:_28").Page("Accela Automation:").WebTable("Required Inspections").GetCellData(6,2)
	Browser("Accela Automation:_28").Page("Accela Automation:").WebCheckBox("Insp180081").Set "ON" @@ script infofile_;_ZIP::Insp180081_ssf157.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation:").WebCheckBox("Insp180081")_;_NFB_;_941081_;_
	Browser("Accela Automation:_28").Page("Accela Automation:").WebCheckBox("Insp180082").Set "ON" @@ script infofile_;_ZIP::Insp180082_ssf158.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation:").WebCheckBox("Insp180082")_;_NFB_;_941081_;_
	Browser("Accela Automation:_28").Page("Accela Automation:").Image("Schedule inspection").Click @@ script infofile_;_ZIP::Schedule_inspection_ssf159.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation:").Image("Schedule inspection")_;_NFB_;_941081_;_
	Browser("Accela Automation:_29").Page("Accela Automation:").Image("Select today").Click @@ script infofile_;_ZIP::Select_today_ssf160.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation:").Image("Select today")_;_NFB_;_941082_;_
	Browser("Accela Automation:_29").Page("Accela Automation:").WebRadioGroup("G6_ACT_T1").Select "AM" @@ script infofile_;_ZIP::G6_ACT_T1_ssf161.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation:").WebRadioGroup("G6 ACT T1")_;_NFB_;_941082_;_
	Browser("Accela Automation:_29").Page("Accela Automation:").Image("Submit").Click @@ script infofile_;_ZIP::Submit_ssf162.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation:").Image("Submit")_;_NFB_;_941082_;_
	wait(5)
	strInnerText = Browser("Accela Automation:_28").Page("Accela Automation:_2").WebTable("Scheduled Inspection").GetROProperty("innertext")
	If instr(strInnerText,strInspName1) <> 0 And instr(strInnerText,strInspName2) <> 0 And instr(strInnerText,"AM") <> 0 Then
       Err_Flag = False
	   Call objTestLib.printfile(file,4)
	Else
		Call objTestLib.printfile(file,5,"cannot find the two inspection items in scheduled inspection table!")
	End If
End Function

Function RescheduleInspection ()
	'b.reschedule two inspections
	Call objTestLib.printfile(file,3,"        b.reschedule two inspections")
	Set oDesc = Description.Create() 
	oDesc("micclass").Value = "WebCheckBox"
	Set WebCheckBoxs = Browser("Accela Automation:_28").Page("Accela Automation:_2").WebTable("Scheduled Inspection").ChildObjects(oDesc)
	strEditValue = WebCheckBoxs(0).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:_2").WebCheckBox("reInsp117428").SetTOProperty "name",strEditValue
	strEditValue = WebCheckBoxs(1).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:_2").WebCheckBox("reInsp117427").SetTOProperty "name",strEditValue
	Browser("Accela Automation:_28").Page("Accela Automation:_2").WebCheckBox("reInsp117428").Set "ON" @@ script infofile_;_ZIP::reInsp117428_ssf163.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 2").WebCheckBox("reInsp117428")_;_NFB_;_951084_;_
	Browser("Accela Automation:_28").Page("Accela Automation:_2").WebCheckBox("reInsp117427").Set "ON" @@ script infofile_;_ZIP::reInsp117427_ssf164.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 2").WebCheckBox("reInsp117427")_;_NFB_;_951084_;_
	Browser("Accela Automation:_28").Page("Accela Automation:_2").Image("Reschedule").Click @@ script infofile_;_ZIP::Reschedule_ssf165.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 2").Image("Reschedule")_;_NFB_;_951084_;_
	Browser("Accela Automation:_29").Page("Accela Automation:_2").Image("Select tomorrow").Click @@ script infofile_;_ZIP::Select_tomorrow_ssf166.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation: 2").Image("Select tomorrow")_;_NFB_;_951085_;_
	Browser("Accela Automation:_29").Page("Accela Automation:_2").WebRadioGroup("G6_ACT_T1").Select "PM" @@ script infofile_;_ZIP::G6_ACT_T1_ssf167.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation: 2").WebRadioGroup("G6 ACT T1")_;_NFB_;_951085_;_
	Browser("Accela Automation:_29").Page("Accela Automation:_2").Image("Save").Click @@ script infofile_;_ZIP::Save_ssf168.inf_;_hightlight id_;_Browser("Accela Automation: 29").Page("Accela Automation: 2").Image("Save")_;_NFB_;_951085_;_
	wait(5)
	strInnerText = Browser("Accela Automation:_28").Page("Accela Automation:_2").WebTable("Scheduled Inspection").GetROProperty("innertext")
	If instr(strInnerText,strInspName1) <> 0 And instr(strInnerText,strInspName2) <> 0 And instr(strInnerText,"PM") <> 0 Then
        Call objTestLib.printfile(file,4)
	Else
		Call objTestLib.printfile(file,5,"cannot find the two inspection items in scheduled inspection table!")
	End If
End Function

Function CancelInspection ()
	'c. cancel two inspection items
	Call objTestLib.printfile(file,3,"        c. cancel two inspection items")
	Set oDesc = Description.Create() 
	oDesc("micclass").Value = "WebCheckBox"
	Set WebCheckBoxs = Browser("Accela Automation:_28").Page("Accela Automation:_2").WebTable("Scheduled Inspection").ChildObjects(oDesc)
	strEditValue = WebCheckBoxs(0).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:_3").WebCheckBox("reInsp117430").SetTOProperty "name",strEditValue
	strEditValue = WebCheckBoxs(1).GetROProperty("name")
	Browser("Accela Automation:_28").Page("Accela Automation:_3").WebCheckBox("reInsp117429").SetTOProperty "name",strEditValue
	Browser("Accela Automation:_28").Page("Accela Automation:_3").WebCheckBox("reInsp117430").Set "ON" @@ script infofile_;_ZIP::reInsp117430_ssf169.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 3").WebCheckBox("reInsp117430")_;_NFB_;_961087_;_
	Browser("Accela Automation:_28").Page("Accela Automation:_3").WebCheckBox("reInsp117429").Set "ON" @@ script infofile_;_ZIP::reInsp117429_ssf170.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 3").WebCheckBox("reInsp117429")_;_NFB_;_961087_;_
	Browser("Accela Automation:_28").Page("Accela Automation:_3").Link("Cancel").Click @@ script infofile_;_ZIP::Cancel_ssf171.inf_;_hightlight id_;_Browser("Accela Automation: 28").Page("Accela Automation: 3").Link("Cancel")_;_NFB_;_961087_;_
	Browser("Accela Automation:_30").Page("Accela Automation:").Image("Cancel Inspection").Click @@ script infofile_;_ZIP::Cancel_Inspection_ssf172.inf_;_hightlight id_;_Browser("Accela Automation: 30").Page("Accela Automation:").Image("Cancel Inspection")_;_NFB_;_961088_;_
	wait(6)
	strInnerText = Browser("Accela Automation:_28").Page("Accela Automation:_2").WebTable("Scheduled Inspection").GetROProperty("innertext")
	If instr(strInnerText,strInspName1)=0 And instr(strInnerText,strInspName2)=0 Then
       Call objTestLib.printfile(file,4)
	Else
		Call objTestLib.printfile(file,5,"cannot find the two inspection items in scheduled inspection table!")
	End If
End Function

Function AssignInspection ()
	'd. assign inspection for the second inspection item
	Call objTestLib.printfile(file,3,"        d. assign inspection for the second inspection item") @@ script infofile_;_ZIP::Accela_Automation__ssf178.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:")_;_NFB_;_961091_;_
	Browser("Accela Automation:").Page("Accela Automation:").Link("Assign Inspection").Click @@ script infofile_;_ZIP::Assign_Inspection_ssf179.inf_;_hightlight id_;_Browser("Accela Automation:").Page("Accela Automation:").Link("Assign Inspection")_;_NFB_;_961092_;_
	Browser("Accela Automation:_31").Page("Accela Automation:").WebCheckBox("SelInspection1").Set "ON" @@ script infofile_;_ZIP::SelInspection1_ssf181.inf_;_hightlight id_;_Browser("Accela Automation: 31").Page("Accela Automation:").WebCheckBox("SelInspection1")_;_NFB_;_971094_;_
	Browser("Accela Automation:_31").Page("Accela Automation:").WebCheckBox("SelInspection2").Set "ON" @@ script infofile_;_ZIP::SelInspection2_ssf182.inf_;_hightlight id_;_Browser("Accela Automation: 31").Page("Accela Automation:").WebCheckBox("SelInspection2")_;_NFB_;_971094_;_
	Browser("Accela 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -