Forum Discussion

Ravik's avatar
Ravik
Super Contributor
8 years ago

Run the Child Test Item hold by a TestItem

Hi,   I have added a New Test Item and under that Test Item I have added Child Test Item.    as per the link - https://support.smartbear.com/testcomplete/docs/reference/project-objects/project/t...
  • baxatob's avatar
    baxatob
    8 years ago

    Hi,

     

    You can do it using tree recursion. I will provide the code in Python:

     

    def get_item_name(node):
        if node.ItemCount > 0:
            for i in range(node.ItemCount):
                Log.Message(node.TestItem[i].Name)
                get_item_name(node.TestItem[i])
    
    
    def main():
        get_item_name(Project.TestItems)