Create file references

You can manually add file attachments to test objects (see chapter "Add attachments").

This chapter describes how to create references to these files in Tosca Commander. Referenced files are files that you don't store in the workspace itself. Instead, the test object in Tosca Commander only points to the file location.

For information on other file storage options and advantages/disadvantages, see chapter "File storage options".

File reference options

You can create the following file references:

  • File references without central storage.

    In this case, the reference in Tosca Commander points to the original location of the file that you attached.

  • File references with central storage.

    In this case, Tricentis Tosca creates a copy of the file and saves it to a central storage location. The file reference in Tosca Commander points to the central storage location, not the original file location.

    Choose this option if the original file location is not easily accessible, or if you want to ensure the original file can't be modified. Additionally, you can restrict access to the central storage location.

If you use Tricentis File Service, you can't reference files.

Tricentis Tosca saves all file attachments to the Tricentis File Service database (see chapter "Store files on Tricentis File Service").

Create a new file reference

To create a file reference, follow the steps below:

  1. If you want to create file references to a central storage location, go to Project->Settings->Commander->Managed Files Area and specify the path to the central storage location.

  2. Drag and drop a file onto the test object, or use the context menu entry Attach file.

  3. In the subsequent Choose file type window, select one of the following options:

    • Linked to create a file reference.

    • Linked managed to create a file reference to the central storage location that you defined in step 1.

  4. Click OK.

You can add multiple attachments. Tosca Commander adds the file(s) to the Attachments folder of the test object.

  • For referenced files, the reference has the same name as the file.

  • For referenced files with a central storage location, Tricentis Tosca adds a unique number to the file name.

Referenced file with a central storage location: attachment name with number

The property FilePath of a reference contains the following information:

  • For referenced files with a central storage location, Tricentis Tosca creates a folder structure with a unique number for each folder. The property FilePath displays the folder structure.

  • For referenced files without a central storage location, it displays the storage directory.

    If you move the referenced file, change the path in the FilePath property. The reference initially shows as broken. Tosca Commander updates the reference once the time you specified in the option Owned File availability timeout has passed.

Open and edit attached files

For information on how to open and edit referenced files, see chapter "Open and edit attached files".

Use path variables

This option is only available for references without a central storage location.

In multi-user environments, users typically store files on network drives. However, the path to shared files on the network drive may be different on different work stations.

You can create path variables that are valid for the entire project.

To do so, set path variables in Project->Options->General->Path Variables. Note: path variables are case-sensitive.

Let's say you have 3 testers who want to reference files:

  • On the work station of Tester 1, the path to shared files on the network drive is J:\FileExchange\SharedFiles.

  • On the work station of Tester 2, the path to shared files on the network drive is D:\SharedFiles.

  • On the work station of Tester 3, the path to shared files on the network drive is X:\MyCompany\FileExchange\SharedFiles.

If Tester 1 creates a reference to a file that's located at J:\FileExchange\SharedFiles\test_reports, Testers 2 and 3 can't access it. On their own work stations, the shared files directory is mapped to a different path.

To make sure that all users can access the file, create path variables:

Path variables

When Tester 1 creates a file reference to J:\FileExchange\SharedFiles\test_reports\report_20210812_553.txt, the file path in Tosca Commander looks like this:

File path in the properties of the file reference

In the workspace of Tester 2, the file path is <PathToSharedFiles2>test_reports.

In the workspace of Tester 3, the file path is <PathToSharedFiles3>test_reports.

Synchronize the file path for existing file references

Once you set a path variable, Tricentis Tosca uses the variable in every new reference that you create.

You can update existing file references, so that they also use the path variable.

To do so, right-click the reference and select Synchronize file path from the context menu.

Restrict access to the central storage location

This option is only available for references with a central storage location.

You can restrict access to the files in the central storage location. Only users with access can then create references or edit them.

Only admin users can manage access to the central storage location.

To manage access, perform one of the following actions:

You need to do this in every workspace whose user should have access to the central storage location.

Alternatively, you can create project settings for your repository as described in chapter "Work with project settings". You only have to do this once, because project settings apply to all workspaces connected to this repository.