Forum Discussion

Herman's avatar
Herman
Contributor
15 years ago

Sharing NameMapping files

I'm working on a test suite containing a series of test for one program. I would like to have only one file with name mapping information. I know I can use "Merge with..." to copy the name mapping from an existing tree into a new tree, but that is not solving my problem, because this means I have to maintain the same information at several places.



I also noted that I could edit the project files (mds files) and change the name of the mapping file there. Is this the only way to do this or is it possible to do this within TestComplete?



The reason I want to have only one file with mapping information is that my tests use a lot of shared code which I maintain in shared script files.

  • I feel that you would love to see something like,



    'USEPROJECT Proj2 like we have 'USEUNIT Login

    and then use a reference like,

    Proj2.Aliases.SomePage.SomeButton.Click()



    Unfortunately you cant do that.

    Dont know if AQA would want to think about this as a suggestion for improvement. I feel that if not NameMapping atleast Aliases can be provisioned to be shared across projects.  



    There was a lot of discussion about sharing stuff across projects in a suite on the message board (the obsolete discussion forum) earlier. Tip: Search for a keywords like "other project" on the board.



    Thank you

    Syed

    www.proteans.com

  • tuscias's avatar
    tuscias
    New Contributor
    You can share NameMapping file across your projects.

    All you need is just go to your newly created project, rightclick on its folder in the ProjectSuite tree and select "Add->Existing Item.." browse to your NameMapping file from any existing project and thats it. Both projects will share the same NameMapping file.
  • Tomas,



    Thank you for your answer.



    I did not think of that solution. I see the same information in the project file ceated this way as after editing the project files by hand.
  • kruczek's avatar
    kruczek
    New Contributor
    I can't do it - in version 7.51 I can't add na *.tcNM files as existing item.



    Mayby I should change something in settings?





    Pawel







  • Hi Pawel,



    Do you have the NameMapping item in the project where you want to add another NM item? If you do, you need to remove it.

  • Hello!




    I have two test-complete projects in my test suite 

    and would like share the name-mapping from the first project in the second one. 





    I integrated the existing mapping-file to my second project, but I can not find the mapped objects!





    for example:





    first project activated.

    searching the button btn_ok with "DisplayObject spy"

    found: Aliases.Sys.DiaShow.frmStartLanguageSelection.btn_OK





    now, second project activated.

    searching the button btn_ok with "DisplayObject spy"

    found: Sys.Process('DiaShow').VCLObject('frmStartLanguageSelection').VCLObject('pnl_Button').VCLObject('btn_OK')





    what am I doing wrong?

  • Hi,



    By what properties are these objects mapped in your Name Mapping file? It looks like the application's process (Sys.Process('DiaShow'), the corresponding alias - Aliases.Sys.DiaShow) is mapped by values which don't match the actual ones. I recommend that you check your Name Mapping scheme and look at this object in the Object Browser to find whether there's a difference.