Search code examples
almhp-quality-center

Get user fields from ALM OTA using python


I am trying to export test cases from ALM to some remote server and following is the working code I have. I have few user defined fields (for example, IsAutomated) in test cases and I am wondering how I can get this value using ota-api.

def get_test_case_recursively(node):
    if node.Count <= 0:
        tests = node.FindTests('')
        if not tests:
            tests = []

        for test in tests:
            print (test.ID, test.Name)
            designStepFactory = test.DesignStepFactory
            for ds in designStepFactory.NewList(''):
                print (description, '\n', expectedResult)
    elif node.Count > 0:
        for child in node.NewList():
            if child:
                get_test_case_recursively(child)

Solution

  • You can get them by using test.Field('TS_USER_01'), replace TS_USER_01 with a field system name that you need.
    You can find system name by calling ITDConnection6.Fields() method

    Edit: adjusted method name - use capital F instead of f