Search code examples
c#hp-quality-centeralm

How to pull the data from HP ALM?


Currently i'm trying to pull the data from HP ALM by using c#. In TestSet1 we have 9 fields: 'Name' 'Type', 'Status', 'Planned Host Name','Exec Date','Responsible Tester', 'Time', 'Planned Exec Date', 'Iterations'.

From the above, i have retrieved first 5 fields successfully and anyone know how to retrieve remaining fields "Responsible Tester", "Time", "Planned Exec Date", "Iterations" from ALM..

for better understanding see my code here: Getting System.__ComObject instead of data while pulling data from HP ALM?

Can anyone help me please...?

Thanks for your help in advance.


Solution

  • You can get them using the Field property:

    test.Field("TC_TESTER_NAME") // Responsible Tester
    test.Field("TC_EXEC_TIME") // Time
    test.Field("TC_PLAN_SCHEDULING_DATE") // Planned Exec Date
    test.Field("TC_ITERATIONS") // Iterations
    

    See this post for how to get the field names like TC_TESTER_NAME. From the OTA Reference, Object TSTest:

    Public Property Field( _
        ByVal FieldName As String _
    ) As Variant
    

    Not having a C#-Environment, I cannot test your code. But this Ruby code works fine (QC11):

    test_set_factory = test_set.TSTestFactory
    test_list = test_set_factory.NewList("")
    test = test_list.Item(1) # Get some test instance from the test set
    puts "ID/Name: #{test.ID}/#{test.Name}"
    puts "Responsible Tester: #{test.Field("TC_TESTER_NAME")}"
    

    Output:

    ID/Name: 85/[1]Test A
    Responsible Tester: roland