Aller au contenu principal

Copy Files Step

The Copy Files step copies files and directories on the file system during test execution. The step is not supported inside a Load Test context. Use it for test setup, artifact management, or preparing file-based request payloads.

When to Use​

  • Copying fixture files into a working directory before a test
  • Archiving test outputs, logs, or screenshots
  • Deploying configuration files before integration tests
  • Preparing file uploads for multipart/form-data requests

Quickest Scenario​

  1. Add a Copy Files step from the step palette.
  2. Set Source Path to the folder (or files) to copy.
  3. Set Target Path to the destination folder.
  4. Run the test — the copied file count is reported in the Information panel.

Configuration​

The step editor exposes the following fields (from CopyFilesPanel.axaml):

FieldTypeDefaultDescription
Source Pathtext(empty)Source folder. Empty = project location; a relative path is resolved against the project location; otherwise an absolute path.
Target Pathtext(empty)Destination folder. Same resolution rules as Source Path.
Search filtertext*.*Filter selecting which files to copy (e.g. *.json, report*.xml).
Recursive copytoggletrueWhen On, labeled "Files in folder only" — actually copies sub-folders and files in sub-folders recursively. When Off, labeled "Files in folder and sub-folders.".
Clean target foldertoggletrueWhen On, "Clean target folder before copy." — deletes all content from the target folder before copying.
Overwrite existing filestogglefalseWhen On, overwrites files already present in the target folder.
remarque

The Recursive copy toggle labels are inverted by design: the control's "On" state corresponds to the non-recursive wording in the UI. The effective behavior follows the Recursive property — true (default) copies sub-folders.

Examples​

Copy a Single File​

Source Path: .\fixtures\test-data.json
Target Path: .\working\input.json
Overwrite existing files: On

Copy All Files Matching a Pattern​

Source Path: .\output\${TestRunId}\*.xml
Target Path: .\archive\${TestRunId}\
Search filter: *.xml

Prepare an Upload Payload​

Source Path: .\fixtures\avatar-${UserId}.png
Target Path: .\uploads\avatar.png
astuce

Reference .\uploads\avatar.png in a Send Request step with multipart/form-data content type to upload the prepared file.

Why​

Copy Files keeps test data and artifacts deterministic: fixtures are staged predictably before a test runs, and results are archived in a known location, which makes local and CI test runs reproducible.

See Also​