Forum Discussion

gentlesea's avatar
gentlesea
Frequent Contributor
14 years ago

Shrink NameMapping to current Project wanted

While working with NameMapping.tcNM the wish came up to minimize the number of the Mapped Objects to the really used ones. This way we could use our big NameMapping.tcNM of the whole application as a starting point for smaller testboxes. TestComplete could offer the option "Shrink NameMapping to current Project" in order to delete all unused entries in the project.



This would also be useful to get rid of things you mapped during the development process which turned out later not to be used.

6 Replies

  • Hello Ernst,

    Currently, this can only be performed manually: by deleting the unused items in the Name Mapping editor.

    However, in our DB, we already have a suggestion to automate this procedure, and your request has increased its rating. Thank you.



    Regards.
  • rmoore_1's avatar
    rmoore_1
    New Contributor
    We would also like to see this feature in a release of TestComplete. Our name mapping file is getting quite large and with the developers constantly making changes, there are a lot of items that are not being used.
  • Is there an update to any progress on this proposed feature (clicking to prune away unused name-mapping entries in a batch)? Can TestComplete users expect anything in a future (imminent?) release? If not, can SmartBear suggest/demo the best practices to most efficiently prune the name-mapping manually?



  • Hi Paul,

     


    I've added your vote to the suggestion. 


    Right now, only manual removing is possible - you can try finding code lines where an object is referenced by looking for its name in the Find dialog and removing unused nodes. Pay attention to the fact that if the Name Mapping file is shared between multiple projects, you need to make sure an object is not referenced in any of the dependent projects before removing the object.


     

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Paul,



    In addition to Tanya's reply, also consider if your test code uses: a) dynamic and/or b) waiting for namemapped element.

    Simple code samples that illustrate the above (untested VBScript):

    Assume that you need to get the reference to the Aliases.Project.Panel.Control namemapped element:

    a)

    Dim strControlName

    Dim oControl

    strControlName = "Control"

    Set oControl = Evaluate("Aliases.Project.Panel." & strControlName)



    b)

    Dim strControlName

    Dim oControl

    strControlName = "Control"

    Set oControl = Aliases.Project.Panel.WaitNamedChild(strControlName)



    I.e.: Make a backup of your namemapping file first, then clean it and then immediately check if all tests are still can be executed.