版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、QTP 测试框架之_作者:Wally )E QTP 测试框架之_作者:Wally )E 1Report HYPERLINK http:/w/ /knowl.ut-Functionruntime=Report HYPERLINK http:/w/ /knowl.ut-Functionruntime=Date&-&Hour(Now)&Minute(Now)&ath=call EndFunctionReportQTP(testCaseName,result,fullPath=ReadLastLine(D:QTP_Frameworkreportconfigmse) ReportExcelFile =
2、fullPath &report.xlsCaptureFilePath=Environment(TCase)=CallReport(result,comment,ReportExcelFile,CaptureFilePath) End FunctionistheIPaddof theexecution Public Function GetIP DimSetobjWMIService=gmts:&ComputerName&SetcolItems=objWMIService.ExecQuery(Select*FromWin32_NetworkAdapterConfiguration Where
3、IPEnabled = True)ForEachobjIteminForEachobjAddressinobjItem.IPAddress If objAddress thenGetIP=objAddress Exit FunctionEnd2Endisthefunctionforisusofexecution,validEndisthefunctionforisusofexecution,validinputare:FAIL?PASS,isthecomment/notesforthisPublicFunctionReport(sS us,sDetails,ReportExcelFile,Di
4、m fso DimoExcelDim ExcelFile DimobjWorkBook Dim objSheetDimNewTC Dim S us Dim tempDimSetfso=SetoExcel=S us=UCase(sS oExcel.Visible=falseSettingexcelIf Notfso.FileExists(ReportExcelFile)Then Getsheetof SetobjSheet=3With.Name=With.Name=TestingResult testing results set the fonts type and size.Range(A:
5、D).Font.Name=.Range(A:D).Font.Size=setthestyleoftheheadoftheerior.ColorIndex=.Range(B1:C1).Font.ColorIndex=.Range(B1:C1).Font.Bold=settheexecution .Range(C6).NumberFormat=SettheBordersfortheDate&Time.Range(C3:C8).HorizontalAlignment=4right4.Range(C3:C8).Font.Bold=.Range(C3:C8).Font.ColorIndex=.Range
6、(C3:C8).Font.Bold=.Range(C3:C8).Font.ColorIndex= FormattheDateandTimeerior.ColorIndex=.Range(B3:C8).Font.ColorIndex=.Range(C3:C8).Font.ColorIndex=.Range(B3:A8).Font.Bold= setstyleforResulterior.ColorIndex=.Range(B10:D10).Font.ColorIndex=.Range(B10:D10).Font.Bold=setstyleforResult .Range(B10:D10).Hor
7、izontalAlignment=- 5End With SetobjSheet=EndEnd With SetobjSheet=EndSet objSheet = oExcel.Sheets(Testing Result)WithEnvironment.Value(Row) =.Range(C7).Value+11 NewTC = False .Cells(Environment(Row),3).Value=S .Cells(Environment(Row),4).value=.Cells(Environment(Row),5).value=clickthislinktoseeSelectC
8、ase.Range(C&Environment(Row).Font.ColorIndex=temp=Date&-&Hour(Now)&Minute(Now)&PngPath=CaptureFilePath&temp&.Hyperlinks.AddobjSheet.Cells(Environment(Row),5),PngPath,CallCapture(temp,Case.Range(C&Environment(Row).Font.ColorIndex=6temp=Date&-&Hour(Now)&Minute(Now)&PngPath=temp=Date&-&Hour(Now)&Minute
9、(Now)&PngPath=CaptureFilePath&temp&.Hyperlinks.AddobjSheet.Cells(Environment(Row),5),PngPath,CallCapture(temp,CaptureFilePath) Case WARNING.Range(C&Environment(Row).Font.ColorIndex=temp=Date&-&Hour(Now)&Minute(Now)&PngPath=CaptureFilePath&temp&.Hyperlinks.AddobjSheet.Cells(Environment(Row),5),PngPat
10、h,CallCapture(temp,EndNewTC=set board.Range(B & Environment(Row) & :D & Environment(Row).Borders(1).LineStyle 1.Range(B & Environment(Row) & :D & Environment(Row).Borders(2).LineStyle 1.Range(B & Environment(Row) & :D & Environment(Row).Borders(3).LineStyle 1.Range(B & Environment(Row) & :D & Enviro
11、nment(Row).Borders(4).LineStyle 1setfonttypeand.Range(B & Environment(Row) & :D & erior.ColorIndex .Range(B&Environment(Row).Font.ColorIndex=.Range(D&Environment(Row).Font.ColorIndex=.Range(B&Environment(Row)&:D&Environment(Row).Font.Bold=7EndIf(NotNewTC)And(S usEndIf(NotNewTC)And(S us=FAIL) .Range(
12、C&Environment(Row).Font.ColorIndex=3 end IfupdateendEnd With save result SetobjSheet=SetobjWorkBook=Nothing Set oExcel = NothingSetfso=EndPublicFunctionCapture(fileNo,CaptureFilePath) Dim datestDim= filename = fileNo & .png filename=Replace(filename,/,) filename=filename=CaptureFilePath+&filename De
13、sktop.CaptureBitmap filenameReporter.ReportEventmicFail,image,imgsrc=&filename&8EndAppendtoEndAppendtotxtDim fileSystemObj,fileSpec,logFile,waySetfileSystemObj=CreateObject(Scripting.FileSystemObject) fileSpec = pathwaySetlogFile=fileSystemObj.OpenTextFile(fileSpec,8,true) ine (CStr(words)SetlogFile
14、=Nothing End FunctionReadlastlineoftxtFunctionReadLastLine(pathway) Dim fso,myfileSetfso=CreateObject(scripting.FileSystemObject) Set myfile = fso.openTextFile(pathway,1,false)WhileNotmyfile.AtEndOfLine temp=ReadLastLine=temp End FunctionFunctionCreatFolderIfNotExist(fldr) Dim fso, msgSetfso=CreateO
15、bject(Scripting.FileSystemObject) If Not (fso.FolderExists(fldr) ThenSetf=fso.CreateFolder(fldr) End IfEnd9Dimfso, tConstForWriting=Dimfso, tConstForWriting=dim stTime dim enTime dim objIEdimOpenFileC:TesthtmlAddNewCaseAddNewCaseAddNewCase3,X,X,X,Pass FunctionToOpentheHTMLFunctionstTime = TimeSet fs
16、o = CreateObject(Scripting.FileSystemObject) Setts=fso.OpenTextFile(strFileName,ForWriting,True) strFileURL = strFileNameEndFunctionToCreateFunctionine(Test Results)order=0width=100% size=2Expectedsize=2Actualts.wri EndFunctionine(Test Results)order=0width=100% size=2Expectedsize=2Actualts.wri EndFu
17、nctionToAddNewts.wri ine(td width=13% bgcolor=# ts.wri ine(td width=24% bgcolor=# ts.wri ine(tdwidth=23%bgcolor=# ts.wri ine( & strTCID FDC valign=top align=justify & strObjective FDCvalign=topalign=justify&strExpectedResultFDC valign=top align=justify & strActualResult color=Greenface=Tahomasize=2&
18、strPassFail&PassPass+ts.wri ine(&strPassFail&FailendFail+color=Greenface=Tahomasize=2&strPassFail&PassPass+ts.wri ine(&strPassFail&FailendFail+EndFunctionToFooterFunctionFooter() Dim EndTime EndTime=TimerenTime=order=0ine(td width=100% face=Tahoma ts.wri ine(font Passed& ts.wri ine(td width=45% Failedface=Tahoma size=2Total Tests Pass & )face=Tahoma size=2Total Fail&ine(td width=45% bgcolor=# Ontd width=55% bgcolor= # Timetdw
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 护理安全标准化流程:建立与实施
- 2025年家庭影院3D眼镜兼容性
- 护理工作与法律法规遵守情况
- 毕业季假期安全教育
- 蚕饲养员安全培训效果知识考核试卷含答案
- 家用电冰箱制造工班组协作能力考核试卷含答案
- 普通过磷酸钙生产工安全技能测试知识考核试卷含答案
- 电动轮自卸车机械装配工创新思维竞赛考核试卷含答案
- 2026年新科教版高中高二物理上册第一单元电场性质综合应用卷含答案
- 高处作业吊篮安装拆卸工发展趋势考核试卷含答案
- 电影鉴赏评论知到智慧树章节测试课后答案2024年秋山东艺术学院
- 2026年1月1日起施行新增值税法全文课件
- 【MOOC】用Python玩转数据-南京大学 中国大学慕课MOOC答案
- 【可见光室内定位系统的设计与实现(论文)8000字】
- 人教版五年级数学下册测试题(全套)-五年下册人教数学测试题
- 2023年深圳市公安局招聘警务辅助人员考试真题
- T-CPA 006-2024 造纸用湿强剂 聚酰胺环氧氯丙烷PAE
- (完整版)全等三角形经典模型总结
- JBT 5300-2024 工业用阀门材料 选用指南(正式版)
- 新能源汽车消防安全培训
- 消防设施维护保养记录表
评论
0/150
提交评论