Absent Member.. Absent Member..
Absent Member..

Trying to get test status information for a particular release using VBA

Becasue the full path information is not working within ALM 12.01 I need to use VBA to get the following report:

List of test case run status ( Failed, Passed, No Run...) for a list of test cases assigned to a particular release. I need Full Path, Test Name, Owner, Test Case Status, and Test Execution Status filtered by tests belonging to a particluar release cycle.

I can get the report of test case information using the TestFactory however I do not see how to filter this list by release cycle (TC_ASSIGN_RCYC) as this field doesn't appear to be in the TestFactory object.


Tags (2)
3 Replies
Absent Member.. Absent Member..
Absent Member..

Re: Trying to get test status information for a particular release using VBA

Hello David,


Thank you for your using HP Forums, my name is Alonso.


Regarding the question, I double check in the database and the values belongs to the test cycles, this means this will be a test instance, a test instance takes the values from the test, checking the reference of the TestFactory Object in the OTA API guide (http://alm-help.saas.hp.com/en/12.50/api_refs/ota/topic9325.html), in the public properties states that the field property, will list the available fields managed by the object.


It seems that this field is not one of the available ones, my suggestion is to take the information from the test and not from the test instance, this way you should be able to retrieve the information regarding the cycles.


Also you can check the description and how the database is linked in the database reference guide:




I hope this information helps you.

Alonso Sequeira Morales
SW Support Technical Consultant
San Jose, Costa Rica
Hewlett Packard Enterprise

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation”
Absent Member.. Absent Member..
Absent Member..

Re: Trying to get test status information for a particular release using VBA


I understand how the database table are linked however my issue is in trying to get the following data:

Test status of test runs of all test associated with a particular release. I need the Test name, the test execution status, the test owner, and the FULL PATH of the test case. In ALM 11 we could do this from a report in the analysis module directly however in ALM 12.01 this function does not work, checking display full path in the configuration of the report results in ALM throwing an undefined error. This has been confirmed by support and i was told they have a Patch 3 for ALM 12.01. I am waiting on the release of this patch however I have a project team with an urgent need for this data.  The test cycle has over 80,000 tests so constructing the report manually is not feasible.  while I can get the test case, the last test execution status and owner from the test plan i need to get the infromtoin on the tests in the test lab. 

 I am trying to use this code but it is giving me errors when iterating through the testlist. I only get about 10 or so items before I get an error item does not exist from the line: Sheets("Data").Cells(Row, 1).Value = TestCase.Field("TS_SUBJECT").Path


Public Sub RefreshTestCaseData()

'Make a connection
Dim QC_Url, QC_Domain, QC_Project, QC_Login, QC_Password As String

QC_Url = "https://xxxxxxxx.com/qcbin/"
QC_Domain = Sheets("Setup").Cells(1, 2)
QC_Project = Sheets("Setup").Cells(2, 2)
QC_Login = Sheets("Setup").Cells(3, 2)

QC_Password = InputBox(Prompt:="Enter password", Title:="ENTER PASSWORD", Default:="")

makeConnection QC_Url, QC_Domain, QC_Project, QC_Login, QC_Password

MsgBox "Refreshing test case data may take a few minutes depending on the number of test cases. Hit OK to start the refresh. You will receive a confirmation message when complete."

Dim TSTestFactory As TSTestFactory

Dim TestList As List
Dim TestCase As TSTEST
Dim Row
Dim TestFilter

Set TSTestFactory = tdc.TSTestFactory
Set TestFilter = TSTestFactory.Filter
TestFilter.Filter("TC_ASSIGN_RCYC") = 5
Set TestList = TSTestFactory.NewList(TestFilter.Text) 'Get a list of all tests
'clear worksheet

'add header row values
Sheets("Data").Cells(1, 1) = "Subject (Folder Name)"
Sheets("Data").Cells(1, 2) = "Test Name"
Sheets("Data").Cells(1, 3) = "Owner"
Sheets("Data").Cells(1, 4) = "Test Case Status"
Sheets("Data").Cells(1, 5) = "Test Execution Status"

'format header row
Selection.Font.Bold = False
Selection.Font.Bold = True
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.PatternTintAndShade = 0
End With

'Start adding after header row
Row = 2

'Iterate through all the tests.
For Each TestCase In TestList

'MsgBox TestCase.Field("TS_SUBJECT")

'If TestCase.Field("TS_SUBJECT") = "" Then
'Sheets("Data").Cells(Row, 1).Value = "Unattached" 'tests that are unattached won't have a value in subject
Sheets("Data").Cells(Row, 1).Value = TestCase.Field("TS_SUBJECT").Path
'End If

Sheets("Data").Cells(Row, 2).Value = TestCase.Field("TS_NAME")
Sheets("Data").Cells(Row, 3).Value = TestCase.Field("TS_RESPONSIBLE")
Sheets("Data").Cells(Row, 4).Value = TestCase.Field("TS_STATUS")
Sheets("Data").Cells(Row, 5).Value = TestCase.Field("TS_EXEC_STATUS")
Row = Row + 1

'Sort by folder then by name
ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add Key:=Range("A2:A65536"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add Key:=Range("B2:B65536"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Data").Sort
.SetRange Range("A1:J65536")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
End With

Acclaimed Contributor.
Acclaimed Contributor.

Re: Trying to get test status information for a particular release using VBA

Try to debug the code to find out which test it is stopping at and what the TS_SUBJECT field contains.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.