Overview
TheFILE_UPLOAD step allows you to upload files to file input elements. It bypasses native file dialogs to directly set files on the input element, making file upload testing reliable and automated.
Parameters
File input element selector. Must target an input element with type=“file”.
Array of file references to upload. Each file reference should include the file path or content.
Wait for the file upload to be processed by the application
Behavior
- Element Location: Finds the file input element using the selector
- Input Validation: Validates that the element is a file input (input[type=“file”])
- File Setting: Sets the files on the input element
- Event Firing: Fires appropriate change and input events
- Optional Processing Wait: Waits for file processing if configured
Common Use Cases
- Uploading profile pictures or avatars
- Submitting documents for verification
- Testing file size and type validation
- Uploading multiple files at once
- Testing drag-and-drop file upload areas
Error Handling
The step will fail if:- The element cannot be found using the selector
- The element is not a file input element
- The specified files do not exist
- The input element is disabled
- The input does not accept the file type being uploaded

