Folder Operations

The folder TBox Automation Tools->Folder Operations in the Standard subset contains the following Modules:

TBox Create Folder

The Module TBox Create Folder allows you to create a folder in a specific location.

It has the following attributes:

ModuleAttribute

Description

Path

Path of the folder you want to create.

Overwrite

By default, Tricentis Tosca doesn't overwrite existing folders. If you want to overwrite the existing folder, set the value True.

In this example, you create the folder C:\Temp.

Create a folder

TBox Copy Folder

The Module TBox Copy Folder lets you copy all contents of a folder you specify into a specific target location. This includes all files and sub-directories of that folder.

It has the following attributes:

ModuleAttribute

Description

Source Path

Path of the folder which contains the content you want to copy to a different location.

Target Path

Path to the destination folder where you want to copy the contents to.

Note the following:

  • If you specify a path that doesn't exist at test execution, Tricentis Tosca creates it for you.

  • If you specify a path that already has files or folders inside, Tricentis Tosca still copies any new content into that folder. However, if there are matching file and folder names, the action that Tosca performs depends on what you specify in the Overwrite ModuleAttribute.

Overwrite

By default, Tricentis Tosca doesn't overwrite existing files or folders.

To overwrite matching contents of the Target Path folder with the Source Path folder, set this value True.

The TestStep in this example performs the following actions:

  • Copies the C:\Source\ directory into C:\Target\ as a sub-directory.

  • Overwrites the existing files and folders in the target directory.

Copy and paste a folder to another directory

TBox Delete Folder

The Module TBox Delete Folder allows you to delete a directory.

It has the following attributes:

ModuleAttribute

Description

Path

Path of the folder you want to delete.

Recursive

By default, Tricentis Tosca only deletes empty folders. If you want to delete a folder that has content, set the value True.

If the system can't locate the folder, the execution result shows the following description: Folder <folder name> does not exist.

The test result is positive.

In this example, you delete the folder C:\Temp and all its contents.

Delete a folder

TBox Folder Existence

The Module TBox Folder Existence allows you to verify whether a folder exists in a specific directory.

It has the following attribute:

ModuleAttribute

Description

Path

Path of the folder whose existence you want to verify.

In this example, you check if the folder reports exists in the directory C:\Temp.

Verify the existence of a folder