Ask a Question

What are different name mapping and Object Browser Naming Notation?

SOLVED
tuanvinh1008
Contributor

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,

6 REPLIES 6
vinniew
Staff

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/inde...

 

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/ov...

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

 

ebarbera
Staff

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

Thanks @ebarbera and @vinniew  for replying. It's helpful for me. 

AlexKaras
Community Hero

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-objec...

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

Hi @AlexKaras 

So it means we should not Name Mapping in our scripts. But we should use Aliases? I still don't understand this. because Name Mapping is using the Aliases for mapping objects in scripts. 

And I agree with you that Object Browser Naming Notation is more difficult to maintain than Aliases.

 

Could you explain more why In a nutshell Name Mapping should not use? and what way should we use?

 

thanks,

Vinh

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...

 

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-environme...

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: