Forum Discussion

levi_bryant's avatar
levi_bryant
Contributor
11 years ago
Solved

Script Extensions that require Name Mapping files



Updating a script extension and then seeing those changes across all projects and test suites is easy. 



I've incorporated objects that require Name Mapping inside my script extension. So any project that uses that script extension now needs its name mapping file updated to use the name mapped objects inside that script extension.



I created a master name mapping file just for that script extension and now when I need to use that script extension in a project i just merge that master name mapping file.



MY PROBLEM:

The main problem is that every time I add a new name mapped object inside my script extension I now have to go to each one of projects and re-merge the newest version of my master name mapping file for that script extension.



MY QUESTION:

Is there a way to share a master name mapping file across all projects similar to how script extensions work?

As it stands it seems like script extensions are best used without name mapped objects. This is not ideal though as name mapping is almost required to have robust scripts that don't intermittently fail.



Thank you so much,



Levi Bryant










  • Hi Levi,


     


    As far as I can see, you've contacted the TestComplete Support team. Here is their reply:


    You can simply share a NameMapping project item with several projects (even if they belong to different project suites). Please see the "Sharing Project Items and Their Child Elements Among Several Projects" help topic (http://support.smartbear.com/viewarticle/32430/). So, it will allow you to have only one NameMapping file stored in a shared folder for all your projects. 


     


    But, please note that the situation when you use NameMapping in script extensions isn't typical. Script extensions are convenient for the creation of utility functions which can be used in different projects, but NameMapping, as you mentioned, makes these functions dependent, and in every project you will need to think about providing the needed condition for their work. Since every object in TestComplete can be addressed by its full name, you can make your script extension more reliable by avoiding using Name Mapping.


     


    The following help topics can be useful:



    "Find Method" (and topics from the "See also" section) -- http://support.smartbear.com/viewarticle/30995/


     

4 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Levi,


     


    As far as I can see, you've contacted the TestComplete Support team. Here is their reply:


    You can simply share a NameMapping project item with several projects (even if they belong to different project suites). Please see the "Sharing Project Items and Their Child Elements Among Several Projects" help topic (http://support.smartbear.com/viewarticle/32430/). So, it will allow you to have only one NameMapping file stored in a shared folder for all your projects. 


     


    But, please note that the situation when you use NameMapping in script extensions isn't typical. Script extensions are convenient for the creation of utility functions which can be used in different projects, but NameMapping, as you mentioned, makes these functions dependent, and in every project you will need to think about providing the needed condition for their work. Since every object in TestComplete can be addressed by its full name, you can make your script extension more reliable by avoiding using Name Mapping.


     


    The following help topics can be useful:



    "Find Method" (and topics from the "See also" section) -- http://support.smartbear.com/viewarticle/30995/


     

  • Hi Natalie,

     

    Thanks for your help.

    I can't use share a namemapping project item because all of my projects already have a namemapping project item.

    This is why I have had to merge my script extension namemapping project item with each projects exist namemapping item.

     

    It looks like my best option may be to avoid name mapping in script extensions but I worry that won't work because the items I have name mapped required things like extended find, required children, wildcarding,  and conditional properties.

    I think I can take care of the wildcarding and conditionals in the code but I'm not so sure about extended find and required children.

     

    How do I get a full name to use extended find and required children?





     

    Thanks so much,

     

    Levi

  • One more thing to add.



    I just tried to use the full name of one of my objects and that full name includes the index number of several objects. I don't want these index values because they are dynamic. In my namemapping file I am able to ignore dynamic indexs by using required children.

    If I remove the indexs from the full name then I get a warning about ambiguous window recognition and the object is not found.



    It does not seem that using the full name of the object gives me the same power I have

    when using extended find and required children when name mapping.



    Thanks, 

    Levi
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Levi,


     


    To continue the conversation with Natalie, you need to reply to her message you got via e-mail. The Support Case ID is M0117864.