0

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)
Fenixs
  • 377
  • 1
  • 4
  • 20

1 Answers1

2

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

Sergi
  • 990
  • 5
  • 16
  • Thanks @Sergi. Your solution worked, but with slight change. test.Field('FIELDS_NAME') worked fine (just replaced f with upper case). – Fenixs Aug 21 '19 at 14:21
  • @Shan Oh yes, you are right! Thanks for pointing that out - I'm using a Java wrapper and it has method names starting with lower case, but in VB/C# it starts with capital F – Sergi Aug 21 '19 at 19:03