Forum Discussion
What happens if the alias of the namemapping changes? All scripts that use that alias namemapping will need to be updated to the new alias name.
Wouldn't returning the namemapped object from a function be more robust if the namemapping changes? Just edit the function in one spot, and all of the scripts are working again.
If your Aliases are changing that much then you aren't really using mapping properly. Your namemapping file should be designed in such a way that your Aliases are only the main parts of the UI you interact with and shortened as mush as possible. The mapping is where the shuffling should be occuring, not the Aliases.
Hi 4m4d3u,
Few months ago i had the same problem as You. This community helped me a alot and today i can share with you theirs topis and solutions:
Generaly the good practics to work with nameMapping is to:
1) Do not map everything! this is a optimization trap! Map only what You must have in NameMapping repo and on that objects use .find() function or .WaitAliasChild() function.
2) Yes ofc you can store dynamic Aliases with functions on external lib. But be very carefouly with TestComplete Execution process.
3) with this example function You can search for object:
var alias = () => anchorFind(...); function anchorFind(alias, propNames, propValues, depth, refresh = true) { return alias.Find(propNames, propValues, depth, refresh); }
Hopes this helps you.