Copying test artifacts
Test artifacts can be reused by copying existing artifacts. The copied artifacts can then be modified without affecting the original test artifact.
In general, the copy operation is referred to as duplicating test artifacts. You can initiate a duplication of a test artifact from the list view or from the artifact editor. Test artifacts can be duplicated to the same project area or to a different project area.
For example, you might duplicate test case execution records from an older test iteration to the next iteration, and then modify the duplicated execution records to test against different environments.
Duplicating artifacts to the same project area
When you duplicate a test artifact to the same project area, the test artifact is duplicated and by default the copy refers to all the associated test artifacts (except test case execution records and test suite execution records). You can choose the copy depth of the duplicated artifact by selecting or clearing options.
For example, if you clear Duplicate with references, a blank artifact is created without links to the original associated artifacts. Otherwise, if you duplicate a test plan using default options, the content of the test plan, such as the business objectives and quality objectives, are copied. However, the duplicated test artifact refers to the associated test artifacts, such as the test cases and test scripts. The duplicated test plan refers to the same test artifacts as the original test plan.
Duplicating artifacts to different project areas
When you duplicate a test artifact to a different project area, many of the fields and the associated test artifacts are also copied.
- Test Plans
- Test Cases
- Test Suites
- Test Scripts
- Test Data
- Test Case Execution Records
- Test Suite Execution Records
- Test Environments
- Keywords
- The test suite execution record is not duplicated if the associated test suite is not a part of the test plan.
- The test case execution record is not duplicated if the associated test case is not a part of the test plan, unless the test case execution record belongs to a test suite execution record that is being duplicated.
- The attachments in the copied artifact are linked to the original attachments in the source project area. You require permissions to access them.
Copieslink do not exist between the source and the target artifacts.
Fields and artifacts that are not copied
Certain fields are not copied when duplicating test artifacts to a different project area. Fields that indicate the state of a test artifact, such as state, review, results, or work-item fields, are not copied. The fields are not copied because copied test artifacts are intended to be new, and, therefore, do not have a status. Fields that are related to lab resources, such as platform coverage or test environments, are not copied because of the uncertainty that the same resources exist in the target project area.
- Categories for test plans, test cases, and test suites
- Channels
- Custom attributes
- Quality Objectives
- Risk Assessments
- Risk Factors
- Shared Resource Locations
- Templates for test plans and test cases
- Test case execution records
- Test Environments
- Test Teams
Copying and replacing test artifacts that are associated to multiple parent artifacts
You can copy and replace a test case, test suite, or test script that is associated to multiple parent test artifacts. You do this by selecting the artifacts to copy in a list view, and then from the Action menu, clicking Copy and Replace <Artifacts>. Copying and replacing artifacts is useful when you want a parent artifact to have its own copy of a child artifact instead of sharing it with other parent artifacts. After copying and replacing an artifact, modifications to the duplicated artifact do not affect the other uses of the copied test artifact.
Only the test cases, test suites, and test scripts that are associated with more than one parent artifact are copied. The copied artifact is associated with the current parent artifact, and that association replaces the original artifact association. For test cases, the test scripts that are associated to the original test case are also copied and associated with the new test cases.
After test scripts are copied and replaced, the list of test scripts is refreshed and the copies are listed instead of the original items. Only the test scripts that are associated to more than one test case are copied and replaced.
Working with duplicated artifacts
You can view the relationships of copied artifacts within artifact table views, such as Browse
Test Plans, by adding the Copy Root and Copied From columns. You can set column display settings
from the Action Bars by clicking the Change Display Settings
icon. You can also use Copy Root to view the oldest ancestor of a copy when you have
multiple versions of an artifact.
Cloning versus copying or duplicating artifacts
If you have enabled configuration management in your project area, you can clone a QM artifact. When you clone an artifact, a new version is added to the stream that you work in, and that artifact now exists in two different configurations. To help you decide which operation to use, see the table Comparison of cloning and copying (duplicating) operations.