Sharing Project Items and Their Child Elements Among Several Projects

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

TestComplete projects have a tree-like structure. A project contains project items that perform various testing operations and store data used in testing. 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 that use the same scripting language. Sharing project items lets you create items that will contain common functionality and use this functionality in several test projects.

To share a project item used in another project with your project, simply add the project item’s file to your project. To do this:

  • Open the Project Explorer panel (if it is hidden, select View | Project Explorer from the TestComplete main menu).

  • If you are going to add a project item, right-click the project node in the Project Explorer.

    If you are going to add a child element of a project item, right-click the project item node.

    Note: Some project items or their child elements cannot be shared among projects that belong to the same project suite. See the Notes section below.
  • Choose Add | Existing Item from the context menu and select the file holding the project item properties (child element properties) from the ensuing Open File dialog.

TestComplete will read properties of the project item (project item’s child element) from the file and add the appropriate node to the project tree.

Notes:

  • Some project items may contain child elements. Sharing such “container” items among projects of the same project suite is not allowed. You can share items that are not containers. 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).

    Note: There is one exception from this rule: it is not allowed to share child elements of the Stores project item within 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.

See Also

Project Items
Adding and Removing Project Items and Their Child Elements
Cloning Projects
Avoiding Computer-Specific Settings
Teamwork

Highlight search results