Forum Discussion

tuanvinh1008's avatar
tuanvinh1008
Contributor
4 years ago

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: 

    https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Problem-in-Name-Mapping-shared-objects-Needs-Help/m-p/154408/highlight/true#M11080

     

  • AlexKaras's avatar
    AlexKaras
    4 years ago

    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

     

6 Replies

  • Hi There, 

     

    They compliment each other more than anything. 

     

    The name mapping repository is what is used to store the criteria of the objects mapped in our tests we add automatically or manually. Its the blue print for how TestComplete recognizes controls

    More information can be found https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/index.html

     

    The object browser shows you how testcomplete can see open windows and controls 

    https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/default-naming/overview.html

    Seeing how TC can see these open windows and controls is useful when trying to troubleshoot recognition issues 

    This video explains the object browser and name mapping. 

    https://www.youtube.com/watch?v=A0M7o3_Q8Kg

     

    Hope this helps

     

  • 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

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    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: 

    https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Problem-in-Name-Mapping-shared-objects-Needs-Help/m-p/154408/highlight/true#M11080