Forum Discussion

Natasha_2012's avatar
Natasha_2012
Contributor
9 years ago

how to get a component object of an object hierarchy without knowing its depth in the hierarchy

I have a window object.  This window object contains a hierarchy of its components.  It can be many levels which I dont know as it can be change during run time, depending on the input. I want to ret...
  • baxatob's avatar
    9 years ago

    You can use some quasi-maximum value e.g. 100

    Another way is to map your element using extended search feature.

  • Colin_McCrae's avatar
    Colin_McCrae
    9 years ago

    As baxatob says, just make the depth value of the search huge.

     

    Of course, if you search through a large object hierarchy, with many child objects of child object etc etc, this can come with a considerable performance hit.

     

    If possible you're always best to start the search as close to the target object as you possibly can.

     

    Using extended find doesn't get round this as it if can't find it initially, it just kicks off a search of the object hierarchy to try and find it .... and you're back to taking the performance hit for it.