|
终于上来专家了,有不少问题问,但愿各个问题给回答到位,帮我解决
1、如何将QC中自动化测试集批量运行结果 ...
lcyu888 发表于 2011-3-3 14:48
Private Sub SaveTestSetResult(ByVal TestSetList, ByVal ConnHandle)
Dim LogName As String = "autorunlog.xls"
Dim CurLogName
CurLogName = AutoTestLogPath + "\" + LogName
Dim xlsApp = CreateObject("Excel.Application")
Dim xlsBook
Dim xlsWork
xlsApp.Visible = False
xlsApp.DisplayAlerts = False
Dim tabName = TestSetList.Name
If System.IO.File.Exists(CurLogName) Then
xlsBook = xlsApp.Workbooks.Open(CurLogName)
Else
xlsBook = xlsApp.Workbooks.Add()
End If
xlsWork = xlsApp.Worksheets.Add()
xlsWork.Columns(2).ColumnWidth = 80
xlsWork.Name = tabName
xlsWork.Cells(1, 1) = "Case ID"
xlsWork.Cells(1, 2) = "Case Name"
xlsWork.Cells(1, 3) = "Test Status"
Dim TSTestFact
Dim TSTestsList
Dim theTSTest
TSTestFact = TestSetList.TSTestFactory
TSTestsList = TSTestFact.NewList("")
Dim row = 2
For Each theTSTest In TSTestsList
'Debug.Print("Test Name: " & theTSTest.Name, "TestID: " & theTSTest.TestId, "Test Status: " & theTSTest.Status)
xlsWork.Cells(row, 1) = theTSTest.TestId
xlsWork.Cells(row, 2) = theTSTest.Name
xlsWork.Cells(row, 3) = theTSTest.Status
row = row + 1
Next theTSTest
xlsBook.SaveAs(CurLogName)
xlsBook.Close()
xlsApp.Quit()
xlsBook = Nothing
xlsApp = Nothing
End Sub |
|