Forum Discussion

Rajesh8's avatar
Rajesh8
Occasional Contributor
7 years ago

Can we automate Name mapping of test complete

Hi,

 

I wanted to use Testcomplete for multiple applications. But everytime i need to name map all the objects of an application which takes lot of time if i want to name map 1000 objects for every application.

 

So is there any possibility to automate name mapping. Like mapping once it will map all the parent objects with child ones.

5 Replies

    • Rajesh8's avatar
      Rajesh8
      Occasional Contributor

      baxatob yes, we can share the Name mapping file between different projects only if it is of same application. But here the problem is i use different projects every week where it will be different applications changing every week.

       

      So i need to name map the objects every week newly for new applications which is a tedious job. Is there any way to automate the name mapping

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Some things to keep in mind:

         

        1) While an application may have thousands of objects in it, not every object needs to be or even should be mapped.  For example, for a web application, table objects on the web application most likely will contain dynamic data that will change depending upon the actions within the application.  Mapping the table is definitely something you want to do, but I would not map every cell because the cells will change. Additionally, there are objects that may be able to be mapped in the application but that you will never interact with when constructing tests.  Simple example is to just open up the Notepad windows application and take a look at it in the object browser.

         

         

        The first two child objects in notepad are two windows that are not displayed anywhere on screen and that you really never have any direct interaction with.  There's no need to map these.  To have TestComplete map all the objects in any application will generate any number of objects that will either not be usable after the initial mapping (like cells in a web table) or have no actual use for automation (like the hidden child objects in NotePad.

         

        2) As I and others have mentioned many times on here before, automatic mapping of any objects, even doing them one at a time, is a good start... but I never keep the automatic maps.  In many modern applications, the properties are a lot more dynamic, a lot more complex, so that keeping the automatic mapping is not guarenteed to work after the automatic map.  So, even if there was a way of auto-mapping all the objects in an application, you would still need to go through and edit the mappings so they will work more robustly.

         

        3) NameMapping is one thing... Aliases is something else.  To quote someone else who posts here frequently, if your Aliases look exactly like your NameMapping, you're doing it wrong.  NameMapping is for the identification.  Aliases is so you can have something that works for your automation.  Again, once something is mapped automatically, 99% of the time I go back and modify the way it shows up in Aliases so that it actually "makes sense" for my usage.

         

        4) Quite frankly, the names that TestComplete gives objects when it automaps sucks rocks.   Again, using the NotePad example... that Edit form almost always gets mapped as just "Edit".  That really has no meaning to me.  Likewise with panels, tables, buttons, forms, pages, etc.  A good best practice is to having a naming standard for your name mapping much like any good software development team has as a standard for naming functions, variables, classes, etc.  So, once you establish such a standard, if you have TestComplete automap everything, you'll still need to go back and edit the mapping to match your standard.

         

        So... all that said, while I understand what you're saying about mapping many objects against multiple applications, practically speaking you still won't be saving much time.  It's better to map what you need as you need it rather than doing it all.