Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning center
The Set File block in Leapwork allows users to upload or define a file as input from various sources, making it available for downstream blocks in an automation flow. This block is essential when a test flow requires files to be attached, processed, or transferred dynamically across multiple steps.
Example: A test case sends an email with a PDF attachment. The Set File block provides the file input—either uploaded by the user or generated by another block—to the "Send Email" block.
Note: This feature is available starting from Release 2025.1.173
When fully expanded, the following is an example of the Set File block with sample data:
The left green input connector in the header is used to trigger the block's execution.
The right green output connector in the header is triggered once the file has been successfully set and is ready for downstream use.
The block title Set File can be renamed by double-clicking on it.
The Set 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).
The Set File block offers multiple file sourcing methods through the Source Type dropdown:
Local Path: Allows manual selection and upload of a local file from the user’s system.
Each option is tailored to different use cases, enabling flexibility in test automation.
Add any number of fields that can contain dynamic content.
This property represents the output of the block, which is a file.
The blue output connector is triggered once the file has been successfully retrieved, making it available as an input for other building blocks in the flow.
This connector is triggered if the Set File block fails to upload or retrieve the file due to issues such as missing file input, unsupported file formats, or internal system errors.
Created 31.3.25
©2024, Leapwork. All rights reserved.