Import and export subsets
Typically, you create and maintain all test artifacts in one repository. If you have multiple repositories because you're splitting up test efforts, you may want to exchange data every once in a while. For example:
-
Move successful experiments from your single-user playground into the common repository, to push them into production.
-
Share frequently-used Modules or standardized TestCases with teams on other projects, to streamline test efforts.
To do this, you need to export a subset of the objects you want to share. Then, import the subset into the other repository.
Prepare for large subsets
Exporting or importing large subsets consumes a lot of memory, which may lead to exceptions or even failure. As a very general rule of thumb, a large subset starts at around 50 MB, depending on how much free memory you have.
To make the export and import process more responsive and less memory-intensive, we recommend that you activate the settings UseLargeSubsetExport and UseLargeSubsetImport.
Export a subset
You can export all contents of a project, or you can export individual objects such as folders, Modules, ExecutionLists, or TestCases.
Perform preparatory steps
Before you export, get ready:
-
Find and merge duplicate Modules, so that you only export the definitive version of a Module and not multiple variations of it. This prevents confusion and extra work in the import repository.
-
Enable synchronization, if you excluded objects from synchronization. This ensures that you can add all necessary objects to the subset.
-
Compact your workspace. This helps to speed up the export.
Perform the export
To export a subset, follow these steps:
-
Select the objects you want to export. To export an entire project, select the project root element.
-
Trigger the export task in one of the following ways:
-
Right-click your selection and select Export Subset from the context menu.
-
Select Home->Export Subset from the ribbon menu.
-
-
In the subsequent dialog, choose where to save the subset and select Save.
Depending on the size of your subset, this may take some time.
What's included
Tosca automatically includes all test artifacts that are directly linked to the objects you export.
For example, for a TestCase, Tosca may include linked Modules, test configuration parameters you defined for this TestCase, a TestStepLibrary,
What's excluded
Tosca excludes the following from exports:
-
Anything you defined for the project root element. For example, test configuration parameters on project root level or project definitions such as properties or user groups. When you export a project, Tosca exports all objects in the project, but not the project root itself or any of its specifications.
-
Access rights you defined in the properties ViewingGroupName and OwningGroupName. If you want to restrict the exported objects in the other repository, you need to redefine access rights after the import.
-
Values of the default properties CreatedAt, CreatedBy, ModifiedAt, and ModifiedBy. Tosca creates new values for these properties when you import the subset.
Import a subset
To get exported test artifacts into another repository, you need to import the subset into this repository.
Keep in mind that Tosca doesn't synchronize imported objects. If you import a TestCase and then change it, the change only applies to the imported version of the TestCase.
Perform preparatory steps
Before you import, get ready:
-
Find and merge duplicate Modules in the import repository. If your subset contains Modules that are duplicates of Modules in the import repository, Tosca offers you the option to merge these Modules during the import. This works best when there aren't multiple versions of the same Module in your import repository.
-
Enable synchronization, if you excluded objects from synchronization. This ensures that Tosca can add all objects without causing discrepancies between your workspace and the repository.
Perform the import
To import a subset, follow these steps:
-
Open any workspace that's connected to the other repository.
-
Check out the desired parent object: the project root element or a ComponentFolder. You can only import into these objects.
-
Trigger the import task in one of the following ways:
-
Right-click the parent object and select Import Subset from the context menu.
-
Select the parent object, then select Home->Import Subset from the ribbon menu.
-
-
In the subsequent dialog, choose the file you want to import and select Open.
-
If your subset contains Modules that are duplicates of Modules in the import repository, you get an additional dialog. There, choose whether to Import or Merge these Modules.
By the way, if you never want to merge during imports, you can keep Tosca from asking. To do this, deactivate the setting UseMergeSubset.
Depending on the size and contents of your subset, this process may take some time.
It doesn't matter whether you import by default or by choice.
In either case, Tosca creates import folders with time stamps, one for each object type. It adds these import folders to folders of the same object type. The location depends on where you trigger the import:
-
If you import into the project root element, Tosca adds the import folders to the standard folders.
-
If you import into a ComponentFolder, Tosca adds the import folders to the respective ComponentFolder.
Location of import folders: import into the project root (left) or import into a ComponentFolder (right)
All imported objects get a new UniqueId.
If you import a subset that contains duplicates of Modules in the import repository, you can choose to merge these Modules during the import workflow.
In this case, Tosca adds all unique objects in import folders, following the logic we've described in the previous section, "What happens when you import".
Additionally, Tosca updates the Modules in the repository with the information from the duplicates in the subset. There are no extra folders for merged Modules. Here's what happens during the merge:
-
Tosca keeps the UniqueId of the original Module in the repository.
-
Tosca adds things that exist in the subset Module but not in the original Module, such as ModuleAttributes or parameters.
-
Tosca unifies property or parameter values. If the Modules have the same properties or parameters but with different values, Tosca overwrites the values of the original Module with those of the subset Module.