tristaanogre's avatar
tristaanogre
Esteemed Contributor
7 years ago
Status:
New Idea

Find, FindChild, FindAllChildren have "visual" object order

I don't know if this has been suggested yet or not.  But one of the things that the TestComplete methods indicated in the subject does is that, rather than finding child objects from the first on the page/form to the last (top down in the object browser), they instead work in reverse.

 

For example, if an application form has 5 buttons with similar information and you use "FindChild" to find one of those buttons, it will find the button that is the last one in the object browser rather than the first one.  FindAllChildren orders the resulting array in a similar "reverse order".

 

While for the most part this isn't a problem, if you want to find the "first" object on a page that matches a certain set of criteria, these functions present a challenge in that you need to account for this reversal.  I'd like to see the Find methods find objects based upon ordering on screen (top down) rather than the reverse (bottom up).

1 Comment

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    I am supporting this request, but, considering that the current behavior (bottom-up order) exists from its initial released implementation and there is already test code relying on it, maybe an additional parameter that will specify sort order may be considered?