I wrote the below code to get a defect status report and it worked out great for me
code:
Dim tdCon As TDConnection
Dim tdGraph As TDAPIOLELib.Graph
Dim tdAnalysis As TDAPIOLELib.Analysis
Dim tdDefectFac As TDAPIOLELib.BugFactory
Sub TestDebug()
Set tdCon = New TDConnection
tdCon.InitConnection "http://testdirector.xxx.com"
tdCon.ConnectProject "Proj", "uid", "pwd"
Set tdDefectFac = tdCon.BugFactory
Dim tdFilter As TDAPIOLELib.tdFilter
Set tdFilter = tdDefectFac.Filter
tdFilter.Filter("BG_STATUS") = "Not Cancel And Not Closed And Not Deferred And Not Tracking And Not Migrated And Not Scheduled"
tdFilter.Filter("BG_USER_08") = """System Test - Pass 1"" Or ""System Test - Pass 2"" Or ""Retrofit Testing"" Or ""Regression Test"""
Set tdGraph = tdDefectFac.BuildSummaryGraph("BG_USER_01", "BG_STATUS", , , tdFilter)
For i = 0 To tdGraph.RowCount - 1
Sheet1.Cells(i + 2, 1) = tdGraph.RowName(i)
Next
For j = 0 To tdGraph.ColCount - 1
Sheet1.Cells(1, j + 2) = tdGraph.ColName(j)
Next
For i = 0 To tdGraph.RowCount - 1
For j = 0 To tdGraph.ColCount - 1
Sheet1.Cells(i + 2, j + 2) = tdGraph.Data(j, i)
Debug.Print "(" & tdGraph.RowName(i) & "," & tdGraph.ColName(j) & ") -> " & tdGraph.Data(j, i)
Next
Next
If tdCon.Connected Then
If tdCon.ProjectConnected Then
tdCon.DisconnectProject
End If
tdCon.ReleaseConnection
End If
Set tdCon = Nothing
End Sub
Now i want to get a status of particular test sets and see the status of all the scripts in the specified test sets. Here is the code that i have written.
code:
Dim tdCon As TDConnection
Dim tdGraph As TDAPIOLELib.Graph
Dim tdTestFac As TDAPIOLELib.TestFactory
Sub TestDebug()
Set tdCon = New TDConnection
Dim tdExecStatus As TDAPIOLELib.ExecutionStatus
tdCon.InitConnection "http://testdirector.xxx.com"
tdCon.ConnectProject "Proj", "uid", "pwd"
Set tdDefectFac = tdCon.BugFactory
Set tdTestFac = tdCon.TestFactory
Dim tdFilter As TDAPIOLELib.tdFilter
Set tdFilter = tdTestFac.Filter
tdFilter.Filter("CY_CYCLE") = "eWinBack or sWinBack or jWinBack"
Set tdGraph = tdTestFac.BuildSummaryGraph("CY_CYCLE", "TS_EXEC_STATUS", , , tdFilter)
For i = 0 To tdGraph.RowCount - 1
Sheet1.Cells(i + 2, 1) = tdGraph.RowName(i)
Next
For j = 0 To tdGraph.ColCount - 1
Sheet1.Cells(1, j + 2) = tdGraph.ColName(j)
Next
For i = 0 To tdGraph.RowCount - 1
For j = 0 To tdGraph.ColCount - 1
Sheet1.Cells(i + 2, j + 2) = tdGraph.Data(j, i)
Debug.Print "(" & tdGraph.RowName(i) & "," & tdGraph.ColName(j) & ") -> " & tdGraph.Data(j, i)
Next
Next
If tdCon.Connected Then
If tdCon.ProjectConnected Then
tdCon.DisconnectProject
End If
tdCon.ReleaseConnection
End If
Set tdCon = Nothing
End Sub
Now the above code is giving me same output for all rows and ist giving the status for all the scripts that exists and not for the scripts in the specified test.
Can anbody help on this??