Forum Discussion

anatar02's avatar
anatar02
Contributor
13 years ago

How to add the objects into the NameMapping.tcNM

Hi All,



I would like to know about the NameMapping.tcNM quite in depth. Can please someone guide me to add and Update the Objects into the NameMapping.tcNM files. I had gone threw the Name Mapping, But unfortunately, could not get any idea even after 10 times. So would be very helpful, if some one explain with an exsample.

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    What are you trying to achieve?  



    If you're looking at editing the file directly, that is not recommended.



    However, there are several ways to add objects, a few ways to edit objects, etc. 



    Could you describe what you are trying to do, what you've attempted, and what results you've gotten that are not what you expected?



    This screencast, while focusing primarily on dynamic properties, also demonstrates some specific things you can do to update/add objects.



    http://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/


  • Thanks Robert Martin for replay.



    Wanted to add the object into the Namemapping manually not by using "map object", the reason I wanted to know this just because, we could not understand the Default Name Mapping which has generated by TestComplete as its so much sophisticated . For a example, I have an object emailform which is the  identifiers (Please refer the screenshot) and noted while making a Map objects action, but we could not find the same objects in the default Name Mapping but its working well and fine!.

    So please find the enclosed Name Mapping which has generated by test complete. And please explain me where I could find the expected objects, in this case emailform??
  • Ashok,


    I agree with Robert, changing the project files manually is not recommended.


    The Name Mapping file you attached to your message does not contain the Page object and has another name of the Email form than you showed on your image. I'd suggest that you map the form once again. When mapping, don't skip any parent object (press OK in the dialog, not Skip).

    In your case, the hierarchy should be similar to this:


    Aliases

      Firefox (the process name)

        Page    (the name of the web page)

           formEmailForm  (the mapped name of your form)


    When you map an object, you tell TestComplete to search for that object using the properties you specify, not the recognition properties used by default.

    At that, TestComplete asks you to map parent objects too, because it needs to know the object hierarchy to find your object faster during the test run. Knowing the parent objects helps TestComplete to narrow down the search range (so that it searches for the form within a specific process, but not among all the windows existing in the system).

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The difference between "Mapped" objects and "Aliases" is that you can "telescope" your hierarchy of objects down to something more manageable in the Aliases.  so, while you may have an object that has 10 or 20 parent objects above it, in the Aliases, using Click and Drag, you can reduce this.