What are different name mapping and Object Browser Naming Notation?
Hi all,
I'm new in Testcomplete. and while researching this tool, I found that we can access to object in 2 ways.
1. Use Name mapping repository for KeywordTest and Script Code (Aliases.Order....)
2. Use Object Browser Naming Notation like that Sys.Process.WinFormsObject('MainForm')
So my question is
What benefit if using Name mapping? and when will we use it?
What benefit if use Object Browser Naming Notation? and when will we use it?
Thanks,
Hi tuanvinh1008
The main difference between the two naming conventions is the use of TestComplete's object repository the "NameMapping".
1. When using the NameMapping all of the objects are stored in a centralized repository and this allows for ease of maintenance. For objects in the NameMapping you are able to specify which properties you would like to use to identify the elements as well. Sometimes there may be dynamic properties that you may not want to use and this can all be changed in one place in the NameMapping. Otherwise you would have to update all of your scripts/keyword tests manually.
2. I am not as well versed in the benefits of this method. One of the reasons why individuals like TestComplete tends to be the ease of maintenance brought on by the NameMapping option. In a case where you do not want to store the object in the repository - this is where you might use the object browser notation.
Hopefully this helps!
Cheers,
Emma
Solutions Engineer, Smartbear
Hi,
In a nutshell: NameMapping should not be used in your test code, but use of Aliases is highly recommended.
With properly crafted Aliases you may create test code that will require less maintenance and will less affect your code base when compared if you use Object Browser naming notation.
Try to search this forum for 'Aliasing' word and go through the returned threads.
As an example, I would recommend this one:
Hi Vinh,
> we should not Name Mapping in our scripts. But we should use Aliases?
Yes, correct.
> Name Mapping is using the Aliases
No. Hierarchy is as follows:
Physical objects structure in Object Browser -> translation table implemented as NameMapping -> logical objects structure implemented as Aliases.
So NameMapping is just the intermediate translation table to map physical objects structure to more convenient and stable logical one.
> why In a nutshell Name Mapping should not use?
I tried to find my post about this, but found the one by tristaanogre where Robert described the same: https://community.smartbear.com/t5/TestComplete-Functional-Web/What-is-the-use-of-Aliases/m-p/151499/highlight/true#M30799
Hope this will make things a bit more clear.
P.S. Found one more thread on the topic: https://community.smartbear.com/t5/TestComplete-Functional-Web/Object-mapping-for-multiple-environments/m-p/206367/highlight/true#M36834