In TestComplete, a project contains project items that perform various testing operations or store test data. Each project item, in its turn, can have a collection of child elements and so on.
You may need to share project items or their child elements with several TestComplete projects. For instance, you may want to share a script unit holding common routines with other test projects. This lets you share common functionality in several test projects.
Note: Some project items cannot be shared. See the Notes section below.
To share a project item used in another project, add the project item file to your project:
To share a project item, right-click the project node in Project Explorer.
To share a child element of a project item, right-click the project item node.
Choose Add > Existing Item from the context menu and select the file storing the project item in the resulting Open File dialog.
TestComplete will add the appropriate item to the project and mark the item with the icon in the Project Explorer. Editing or deleting the shared item will affect all projects that share the item.
You can share the Name Mapping project item the same way you share other project items. You can also merge the Name Mapping items, that is, export Name Mapping data from one project to another. See Merge Name Mapping Files.
Project items that contain child elements, the container or collection items, cannot be shared among projects that belong to the same project suite. You can share items that are not containers though. For example, you can share individual keyword tests or script units, but you cannot share the KeywordTests or Script project item as they are collections (containers).
When sharing script units, make sure that projects among which you share them have the same scripting language.
Child elements of the Stores collection cannot be shared among projects that belong to the same project suite.
You cannot share user forms. To get around this limit, try using a script extension with a user form.
Some project items may only be included in the project once. If your project already contains this item, you will be unable to add it.
You can share script units. A possible alternative to sharing the units is to use the script extensions technology and create custom objects.
TestComplete does not share Test Visualizer images associated with keyword test operations or script lines when you are sharing keyword tests or script units among several projects.
Also, if you change a keyword test or a script unit in a new project, the links between test commands and Visualizer images in other projects will be altered and may become invalid. So, it is recommended to change a shared keyword test and script code only in that project where Visualizer images for this test or script code were recorded.
If you share some project items with other projects that reside on different computers, you may need to change the item’s settings or script code. For information on possible problems and workarounds, see Computer-Specific Settings.
Adding and Removing Project Items and Their Child Elements
Avoiding Computer-Specific Settings