QTP:EXCEL报告输出格式源码

上传人:平*** 文档编号:12791246 上传时间:2017-10-20 格式:DOCX 页数:7 大小:18.72KB
返回 下载 相关 举报
QTP:EXCEL报告输出格式源码_第1页
第1页 / 共7页
QTP:EXCEL报告输出格式源码_第2页
第2页 / 共7页
QTP:EXCEL报告输出格式源码_第3页
第3页 / 共7页
QTP:EXCEL报告输出格式源码_第4页
第4页 / 共7页
QTP:EXCEL报告输出格式源码_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《QTP:EXCEL报告输出格式源码》由会员分享,可在线阅读,更多相关《QTP:EXCEL报告输出格式源码(7页珍藏版)》请在金锄头文库上搜索。

1、这个报告输出是根据网上的 Reporter9 框架修改出来得,简化了一些,我个人觉得实用性比较高一点,最近看到论坛里面很多人问这个问题,希望能帮到大家*XXXXXXXXXxXXXXX 有限公司-XXXXX 系统自动化脚本* 脚本名称: 报告模块 * 脚本版本: 1.0 * 脚本描述: 测试报告结果输出 * 脚本作者: * 编写时间: * 脚本修改: * 修改时间: * 修改备注: *参数: ReportExcelFile报告输出的路径Public ReportExcelFileReportExcelFile = Environment (TestDir)& & 测试结果 & Date & -&

2、 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 Wher

3、e 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

4、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).

5、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).

6、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

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号