Quantcast
Channel: All Quality Center / ALM Practitioners Forum posts
Viewing all articles
Browse latest Browse all 14708

Extracting Test Lab Results to EXCEL with VBA

$
0
0

I am attempting to build a tool to extract results for tests contained within a test set in Test Lab.

 

I have scripted the code (attached) however I get:

 

Run-Time Error '-2147417848 (80010108)':

Method 'TestSetFactory' of object 'ITestSetFolder2' failed

 

when the code attempts to run. The excel Debugger highlights the following code:

Set tsf = tsl.TestSetFactory ' Connect to Test Sets
The Full Code is pasted Directly from the module below:

Sub getStats()
'------------------
Dim tsl
Dim tsf As TestSetFactory
Dim Tset As TestSet
Dim testInLab, testList
Dim test As TSTest
Dim Row As Integer
Dim testID, CycleID, TsetInstance, Cycle, TestOrder, Status, TsetName, ActualTester, ExecDate, ExecTime
Dim VTS, TaskStatus, Tpath, tso
Dim Nod
Dim cyc As Integer
Dim tst
Dim TSTSET
'-----------------
writeHead
'-----------------
Row = 4
Nod = WorksheetFunction.Lookup(IMPORTER.QC_FOL_BOX.Value, Sheets("NODELIST").Range("NODE_LIST"), Sheets("NODELIST").Range("NODE_ID"))
Msgbox Nod
'------------------
Set tst = tdc.TestSetTreeManager ' Connect to test lab
Set tsl = tst.NodeById(Nod) ' Connect to folder node
Set tsf = tsl.TestSetFactory ' Connect to Test Sets
Set tso = tsf.NewList("") ' Get list of test sets
'--------------------
For Each Tset In tso ' for each test set in the list
'---------------------
Set testInLab = Tset.TSTestFactory ' Connect to list of tests in the testset
Set testList = testInLab.NewList("") 'get list of test sets
'---------------------
'nPath = Tset.TestSetFolder.NodeID
Tpath = Tset.Name ' set Tpath as the name of the test set

'--------------------
totalTestCount = totalTestCount + testList.Count
Msgbox (totalTestCount) ' display total of tests in the test set

    For Each test In testList
'------------------
    testID = test.Field("TC_TEST_ID")
    Status = test.Field("TC_STATUS")
    TsetName = test.Field("TC_TESTER_NAME")
    ActualTester = test.Field("TC_ACTUAL_TESTER")
    ExecDate = test.Field("TC_EXEC_DATE")
    Range("b" & Row).Value = Tpath & "\" & test.Name
    Range("c" & Row).Value = Status
    Range("d" & Row).Value = TestName
    Range("e" & Row).Value = ActualTester
    Range("f" & Row).Value = ExecDate
    Row = Row + 1
    Next
'----------------
Set testsinlab = Nothing
Set testList = Nothing
'---------------
Next 'end of processing
'---------------------
Set tsf = Nothing
Set tsl = Nothing
'-----------------
Set testFilter1 = Nothing
Set oTestSet = Nothing
Set tdc = Nothing

Msgbox "Finished"
End Sub

 Please Help as it's been doing my head in trying to work it out (as you've probably guessed from my code I'm relatively new to this)

 

Thanks

VBASeraph


Viewing all articles
Browse latest Browse all 14708

Trending Articles