Forum Discussion

gehrig44's avatar
gehrig44
Occasional Contributor
14 years ago

Make a routine global for all projects in a project suite.

Currently, I keep adding the same script unit to each of my projects.  It seems like I should be able to create a global routine so that if I need to change the routine in the future, I will only need to change one of them.



The "Calling Routines in another Project" doesn't exactly cover what I am looking for since, I am basically adding these routines to keyword tests.



The only thing I can think of, is to create a Routines project, put the routine in there and create a script that references it (USEUNIT) in every project.



Is there a better way to control a script routine globally?  Creating an extension looks pretty complicated, and I am not sure if it will work since I am using C#.

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Edward,



    Alternatively, you can add script unit as already existing one to all projects (Right-click|Add|Existing Item...). In this case all projects will reference the same physical file and if you change it in some project the change will propagate to all projects that reference this unit.



    Also you can put the code into ScriptExtension (see relevant TestComplete help topic for more details).
  • gehrig44's avatar
    gehrig44
    Occasional Contributor
    Ah.. stupid me.  I have already been adding my scripts in the method described above.  But, I assumed they there saved as seperate entities.   I just tried making changes and it worked perfectly!



     Thanks!