Sharing test scripts between multiple projects
- 6 years ago
The most reliable way of sharing a code unit between projects is to Add -> Existing item a script unit. This is the tried and true way. While using "import" allows you to import the code without having to share the file, as noted, it's not always visible that the file is in use. Additionally, the "import" needs to make sure that the necessary file is in the same path. Adding the existing item brings the file into both projects which allows you to edit it in both places.... with a caveat... that you need to make sure that any edits you make don't adversely affect the other project.
- 6 years ago
1) No... they part of the project, therefore they are visible somewhere. Please keep in mind, there is no concept of a "parent" project in TestComplete. You have a project where you're developing the shared code, and projects that consume it. There's no parent/child relationship between the two there's no basis for hiding it.
2) There is no "import" dialog available for Python. This is a JavaScript only feature of TestComplete. To share code between units IN THE SAME PROJECT for python, see https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-unit/python.html