Calling Routines Declared in Another Project

Applies to TestComplete 14.40, last modified on April 22, 2021

If you have several test projects, you may want to use the same routines from one project in another project. The uses, import or USEUNIT clause added to a unit lets you refer to routines defined in other units of the same project. (See Calling Routines and Variables Declared in Another Unit). If you need to call routines defined in a unit from another project, you should add a unit that holds these routines to your project. Adding an existing unit does not create a copy of this unit, it just adds a unit reference to the project.

To add an existing unit to your project, right-click the Script project item in the Project Explorer panel and choose Add | Existing Item from the context menu. This displays the standard Open File dialog where you can specify the unit's file.

If the unit includes routines that you do not want to “export”, you can --

  • Create a new unit by right-clicking the Script project item in the Project Explorer panel and selecting Add | New Item from the context menu.
  • Copy the needed routines to this unit.
  • Add the new unit to the desired project.

You may even create a “library” of units containing the desired routines, and then add these units to any project.

See Also

Calling Routines and Variables Declared in Another Unit from GUI

Highlight search results