Earlier this month, we added a new file picker that could reuse a file your test downloaded earlier in the same run. Now you can also create a file variable directly, without needing an earlier download step, and reference it from any upload step.
- Maintainability - upload a file once and reference it from any file upload step in the test.
- Single source of truth - update the file once and every reference updates. And it renders as a filename and download link in the test variables instead of a blank, unreadable value.
Try it out
- With your test open in the mabl Trainer, go to {x} > Manage variables > Data-driven variables.
- Select New file variable, give it a name that's easy to recognize in the file picker, and choose the file to upload.
- Select Apply to save the variable. File variables show their filename and a download link in your test's variable table, instead of a blank or unreadable value.
- When you record a file upload step, select "File variable" as the File source and then select your file variable.
- Click OK to complete the file upload step. mabl sets the file on the page and records the step, so the upload runs the same way every time you replay the test.
File variables are available for browser tests recorded in the mabl Trainer, on the latest version of the mabl Desktop App. Referencing a file variable from a mobile upload step or an API request body is not yet supported.