Copy Test Plans Actions

Copy Test Plans actions may be used to copy one or more test plans between folders in the same ALM Test Repository, or to copy one or more test plans to a different ALM Test Repository. This allows a set of template test plans to be used in one or more projects or project folders. Optionally, each source test to be copied may be associated with its own target folder.

Copying Test Plans to a Target Folder

The Copy Test Plans action uses the following action properties when copying test plans to a target folder. Setting the TestRepository1 and TestRepository2 parameters to refer to the same Test Repository project allows tests to be copied to a different folder in the specified project.

Action Property Description

Copy Mode

A String parameter which determines whether a column in the Source table should be used to determine the target folder for each copied test. This parameter should be set to ‘Default’, or left unset.

Result

A Table dataset containing details of the copied test plans.

Source

A Table parameter or dataset containing the IDs of the test plans to copy.

Source Root

A String parameter containing the root folder from which to copy test plans. Path components should be separated with a backslash character (\), for example, Subject\Master.

Tag Label

A String parameter which stores the label name of custom test field. The Tag Value value is written to the field for tests that have been copied. The Tag Label field is updated for copied tests in the target folder.

Tag Value

A String parameter which stores a value that is written to the Tag Label field for tests that have been copied. The Tag Label field is updated for copied tests in the target folder.

Target Root A String parameter which contains the path of the target folder to which the test plans will be copied, starting with the Subject folder. Path components should be separated with a backslash character (\), for example, Subject\Projects\MyProject.
TestRepository1 A Test Repository parameter or dataset referring to the Source ALM Test Repository.
TestRepository2 A Test Repository parameter or dataset referring to the Target ALM Test Repository.

The target path is determined by removing the Source Root path from the test to be copied (assuming it can be found in the test’s path). The resulting path is appended to the Target Root path to obtain the target path.

The TestRepository1 and TestRepository2 parameters must point to ALM instances of the same version.

Example:

Copy Test Plans action example (Default mode).

The Source table should have the following column:

Column Description

SOURCE_TEST_PLAN_ID

The ID of a test plan from the Source Root folder.

The Result dataset has the following columns:

Column Description

SOURCE_TEST_PLAN_ID

The ID of a test plan that was copied.

TEST_PLAN_NAME

The name of the test plan.

SOURCE_TEST_PLAN_PATH

The path from which test plan was copied.

TARGET_TEST_PLAN_ID

The ID of the target test plan.

TARGET_TEST_PLAN_PATH

The path to which test plan was copied.

STATUS

This column is set to ‘Copied’ if the test plan was copied successfully, to ‘Already Exists’ if the test plan was not copied because it already exists in the target folder, or to ‘Created or reused TARGET_TEST_PLAN_PATH’ if the action was used to create a test plan folder structure in the target project.

Copying Test Plans Using Source Paths

If the Copy Test Plans action’s Copy Mode parameter is set to ‘Source’, the action uses a PATH column in the Source table to identify the target folder for each copied test. Setting the TestRepository1 and TestRepository2 parameters to refer to the same Test Repository allows tests to copied to different folders in the specified project.

Action Property Description

Copy Mode

A String parameter which determines whether a column in the Source table should be used to determine the target folder for each copied test. This parameter should be set to ‘Source’.

Result

A Table dataset containing details of the copied test plans.

Source

A Table parameter or dataset containing the IDs of the test plans to copy, and the paths to which they will be copied in the target Test Repository.

Source Root

A String parameter containing the root folder from which to copy test plans. Path components should be separated with a backslash character (\), for example, Subject\Master.

Tag Label

A String parameter which stores the label name of custom test field. The Tag Value value is written to the field for tests that have been copied. The Tag Label field is updated for copied tests in the target folder.

Tag Value

A String parameter which stores a value that is written to the Tag Label field for tests that have been copied. The Tag Label field is updated for copied tests in the target folder.

Target Root A String parameter which contains the path of the target folder to which the test plans will be copied, starting with the Subject folder. Path components should be separated with a backslash character (\), for example, Subject\Projects\MyProject.
TestRepository1 A Test Repository parameter or dataset referring to the Source ALM Test Repository.
TestRepository2 A Test Repository parameter or dataset referring to the Target ALM Test Repository.

The target path is determined by removing the Source Root path from the test to be copied (assuming it can be found in the test’s path). The resulting path is appended to the Target Root path to obtain the target path.

The TestRepository1 and TestRepository2 parameters must point to ALM instances of the same version.

Example:

Copy Test Plans action example (Source mode).

The Source table should have the following columns:

Column Description

SOURCE_TEST_PLAN_ID

The ID of a test plan from the Source Root folder.

PATH

The path that will be created in the Target Root folder for the test plan when it is copied. Each path entry may be either a single folder (for example, CR101), or a multi-folder path (for example, Sales\CR102).

For example, consider the following test plan structure underneath the Source Root folder:

Subject

Master

Finance

T1 (ID: 1639)

Sales

T2 (ID: 1640)

If the Source table is set to contain the following…

SOURCE_PLAN_TEST_ID PATH

1639

Finance\CR101

1640

Finance\CR101

1640 Sales\CR102

… then the Target Root folder (in this example, Projects\Fusion) will look like this after the tests have been copied:

Projects

Fusion

Finance

CR101

T1

T2

Sales

CR102

T2

The Result dataset has the following columns:

Column Description

SOURCE_TEST_PLAN_ID

The ID of a test plan that was copied.

TEST_PLAN_NAME

The name of the test plan.

SOURCE_TEST_PLAN_PATH

The path from which test plan was copied.

TARGET_TEST_PLAN_ID

The ID of the target test plan.

TARGET_TEST_PLAN_PATH

The path to which test plan was copied.

STATUS

This column is set to ‘Copied’ if the test plan was copied successfully, to ‘Already Exists’ if the test plan was not copied because it already exists in the target folder, or to ‘Created or reused TARGET_TEST_PLAN_PATH’ if the action was used to create a test plan folder structure in the target project.