Forum Discussion

artifex's avatar
artifex
New Contributor
15 years ago

Extended Find_NameMapping vs. FindChild

**  TC v7.5

javaScript

 



Hello everyone.



I´ve been having the same problem since I first used TC for testing webpages. As I read in another post, the namemapping and aliases feature works just fine when the object locations are not changing too much. But when it comes to dynamic tables, cells objects this gets complicated and it requires some maintenance. I´ve also found the Extended Find feature which now I am going to use, since I was not aware of its existence.



On the other hand, I´ve been trying to make use of the NativeWebObject.Find and the FindChild methods to locate the same objects without having to map them in. The big deal with this is the time that takes TC to actually locate these objects so I can perform an action on them.



Having this two different strategies, I am asking whether there is a way to increase the performance of the FindChild method regarding the timing and/or Extended Find feature would be the best solution. I believe that maybe combining both approaches I could get a good solution, but I am not sure. I´d appreciate it if someone could suggest what to do about this.



Thanks





Sebastian





2 Replies

  • Hi Sebastian,



    It looks like Extended Find would be the best and the most convenient approach in this case. As for FindChild's speed, it may depend on different things (the number of objects in your application, the hierarchy level of the target object, etc.). I recommend that you call FindChild belonging to the nearest known parent of the target object.

  • cbruck_1's avatar
    cbruck_1
    Occasional Contributor
    FindChild on an entire page can be fairly slow.  The solution I've used for this in the past is to do something akin to what AQA is suggesting, which is to narrow the search.  If your page has 5 main panels, for instance, you can gather the panel that the control is a part of when you first identify it, so that you can either directly address the panel (if it's static), or use a FindChild with a low depth value to get the panel, then FindChild from there to get the specific control.



    It really depends on the structure of your page (ours had 5 panels, which were all children of the Form, which made finding them quick - and that cut down the raw number of objects we had to search significantly).