资源预览内容
第1页 / 共7页
第2页 / 共7页
第3页 / 共7页
第4页 / 共7页
第5页 / 共7页
第6页 / 共7页
第7页 / 共7页
亲,该文档总共7页全部预览完了,如果喜欢就下载吧!
资源描述
这个报告输出是根据网上的 Reporter9 框架修改出来得,简化了一些,我个人觉得实用性比较高一点,最近看到论坛里面很多人问这个问题,希望能帮到大家*XXXXXXXXXxXXXXX 有限公司-XXXXX 系统自动化脚本* 脚本名称: 报告模块 * 脚本版本: 1.0 * 脚本描述: 测试报告结果输出 * 脚本作者: * 编写时间: * 脚本修改: * 修改时间: * 修改备注: *参数: ReportExcelFile报告输出的路径Public ReportExcelFileReportExcelFile = Environment (TestDir)& & 测试结果 & Date & -& Hour(Now) & Minute(Now)& Second(Now) & .xls描述:GetIP 捕获运行脚本的电脑Public Function GetIPComputerName=.Dim objWMIService,colItems,objItem,objAddressSet objWMIService = GetObject(winmgmts: & ComputerName & rootcimv2)Set colItems = objWMIService.ExecQuery(Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True)For Each objItem in colItemsFor Each objAddress in objItem.IPAddressIf objAddress objSheet.Cells(Environment(Row)-1,2).value Then.Cells(Environment(Row),2).value = TestcaseName.Cells(Environment(Row), 3).Value = Status.Cells(Environment(Row), 4).value = sDetailsSelect Case Status Case FAIL.Range(C & Environment(Row).Font.ColorIndex = 3Case PASS.Range(C & Environment(Row).Font.ColorIndex = 50Case WARNING.Range(C & Environment(Row).Font.ColorIndex = 5End SelectNewTC = True.Range(C7).Value = .Range(C7).Value + 1设置边界.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 & Environment(Row).Borders(4).LineStyle = 1设置字体和颜色.Range(B & Environment(Row) & :D & Environment(Row).Interior.ColorIndex = 19.Range(B & Environment(Row).Font.ColorIndex = 53.Range(D & Environment(Row).Font.ColorIndex = 41.Range(B & Environment(Row) & :D & Environment(Row).Font.Bold = TrueEnd IfIf (Not NewTC) And (Status = FAIL) Then.Cells(Environment(Row), 3).Value = Fail.Range(C & Environment(Row).Font.ColorIndex = 3end If更新结束时间.Range(C5).Value = Time .Columns(B:D).Select.Columns(B:D).AutofitEnd WithoExcel.ActiveWindow.FreezePanes = True保存结果objWorkBook.SaveoExcel.QuitSet objSheet = NothingSet objWorkBook = NothingSet oExcel = NothingSet fso = NothingEnd Function
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号