Forum Discussion
alinder
14 years agoContributor
Thanks Anil for finding that. The forum interface won't let me go back to revise the code sample.
As you can obviously tell from your experience, I haven't used the snippet for exporting the Name Mapping in some time. The reason for that was that we found the best way (in our case) to use abstract object references from our framework with TestComplete was to rely mostly on Aliases.
The framework we implemented was constrained to only use 2 abbreviated text identifiers to identify a given object. This was perhaps excessively primitive.
For an example object, such as Aliases.App1.Obj1.Obj2.Obj3, we needed to write code in TestComplete so that we could find it with just Obj1 and Obj3.
The most stable approach was to use Find() or FindChild() to look for an object that had MappedName = "*Obj1*Obj3" - which works for all objects in the Name Mapping with or without an alias - but this was very slow in execution, taking 7-9 seconds to identify each object.
WaitAliasChild() returns much faster, but requires more error checking, and it requires that you follow more strict rules in the mapping of the application to aliases. Even so, we find that identifying objects from the primitive references is the biggest bottleneck we have in execution performance.
As you can obviously tell from your experience, I haven't used the snippet for exporting the Name Mapping in some time. The reason for that was that we found the best way (in our case) to use abstract object references from our framework with TestComplete was to rely mostly on Aliases.
The framework we implemented was constrained to only use 2 abbreviated text identifiers to identify a given object. This was perhaps excessively primitive.
For an example object, such as Aliases.App1.Obj1.Obj2.Obj3, we needed to write code in TestComplete so that we could find it with just Obj1 and Obj3.
The most stable approach was to use Find() or FindChild() to look for an object that had MappedName = "*Obj1*Obj3" - which works for all objects in the Name Mapping with or without an alias - but this was very slow in execution, taking 7-9 seconds to identify each object.
WaitAliasChild() returns much faster, but requires more error checking, and it requires that you follow more strict rules in the mapping of the application to aliases. Even so, we find that identifying objects from the primitive references is the biggest bottleneck we have in execution performance.