Forum Discussion
I don't want to use NameMapping anymore. I have about 7 Projects in my ProjectSuit and the NameMapping becomes bigger and bigger. We have aklready about 2000 objects and in some cases a performance issue. It's not like re-inventig the wheel but using another method
Have you looked into using the "WaitProperty" method? Once you find the object and verify it exists, you can use WaitProperty method on that object to wait for a property of the object to match an indicated value.
- maxtester8 years agoContributor
I use the waitproperty in my project. But this is still the same prblem. When I pass an 'Alias' everything is fine. As soon as I use the FullPath the object does not refresh in another function.
- tristaanogre8 years agoEsteemed Contributor
The difference has to do with how Aliases work... there actually is an implied "find" that goes on when TestComplete accesses an object via Alias which tells it to go looking. Using the raw full name expects the object to be there immediately.
If you want to use the full name, you should have the last item in the tree be referenced using the appropriate "WaitNNN" method.... like "WaitWindow" or "WaitVCLObject" or something similar. This will tell TestComplete to wait for the object to be present and do some implicit refreshing of the object tree.
- AlexKaras8 years agoCommunity Hero
Hi,
Robert is correct, Aliases use 'late binding' and thus can resolve the case when some object was recreated. Full names started from Sys keep initial reference to the target object. If the initial object is recreated, the reference does not refresh and still points to the initial (void) object.
One note: when using the full name, *all* objects along the path *must* exist. So not only the last item should be referenced using WaitXXX(), but all items along the path. (Well, except Sys, obviously.)