Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning center
The Save File block in Leapwork enables users to store generated test results as files in a predetermined location, making them available for further use in automation workflows. This feature is crucial for ensuring that data persists across test runs and can be accessed for validation, reporting, or external integrations.
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.
Note: This feature is available starting from Release 2025.1.
When fully expanded, the following is an example of the Save File block with sample data:
The left green input connector in the header is used to trigger the block to execute and save the file.
The right green output connector in the header is triggered once the file has been successfully saved. This allows subsequent blocks in the automation flow to continue execution only after the file is stored.
The block title Save File, can be changed by double-clicking on it and typing a new title.
The Save File block supports multiple file formats, including .txt, .csv, .json, .pdf, .xlsx, and .xml
as input. The file content is dynamically provided from other blocks within the automation flow and stored in the Leapwork database (DB).
Note: No manual file selection or path configuration is required.
This connector is triggered if the Save File block fails to save the file due to issues such as storage limits or internal errors.
If the Default Timeout property checkbox is not selected, the timeout value is 10 seconds. If the Default Timeout property checkbox is selected, then the Default Timeout value selected in the flow settings will be applicable.
The maximum time allowed for saving the file before failing and triggering the Not Saved connector.
Note: All cases have a “global timeout” that can be configured in the “Settings” panel. This is unrelated to the timeout of a single building block. However, a running case will automatically be cancelled if it runs for longer than the global timeout.
After execution, a checkbox in the Keyframes section allows users to download the saved file. This option is also available in reports for previous test executions.
By default, files are automatically saved with a unique file name in the following directory:
C:\Program Files\Leapwork\Assets\AutomationRunMedia\SomeFolder\SomeFolder\Files\File name.ext
Behavior Details:
Empty Input Handling:
"Cannot save the file. Please add content before saving."
Successful Execution:
"File {file name.ext} saved successfully."
Updated 4.3.25
©2024, Leapwork. All rights reserved.