save file.md

Save File

The Save File block allows you to store files generated during test execution in a fixed location. This ensures that file-based output (such as logs, reports, or exports) can be reused, analyzed, or retrieved by other parts of the automation flow.

This block supports common formats like .txt, .csv, .json, .pdf, .xlsx, and .xml, and does not require a manual file path. Content is passed dynamically and saved in the Leapwork database and file system.

Example: A test case generates a JSON report containing API response data. Using the Save File block, this report is saved in a predefined storage location, allowing subsequent test cases to retrieve and analyze it.

When fully expanded, the following is an example of the Save File block with sample data:

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick Start

  1. Drag Save File onto the canvas.
  2. Connect File Input to the output of a block that provides file content (e.g., a block that generates or returns a file).
  3. Run the flow when it's ready.

Building block parameters

Parameters

The block title Save File, can be changed by double-clicking on it and typing a new title.

"Cannot save the file. Please add content before saving."

Additional behavior

"File {file name.ext} saved successfully."

The filename is automatically generated to ensure uniqueness. This confirms that the file content was written and stored as expected.

The same download option is available in test reports for completed runs, making it easy to retrieve generated files even after execution has finished.

C:\Program Files\Leapwork\Assets\AutomationRunMedia\SomeFolder\SomeFolder\Files\

The exact subfolders depend on the run context, but Leapwork manages the full path internally. No manual path configuration is required.

Resources

Topic Description
Flows FAQ Common questions about creating, running, and managing flows in Leapwork.
Flows Troubleshooting Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.