The mabl Trainer supports file upload steps, allowing you to test applications that involve uploads exactly as an end user would do. This guide outlines how to record a file upload step in the Trainer, where to manage file uploads for your mabl workspace, and some frequently asked questions.
Recording a file upload step
To get started, open the mabl Trainer and navigate to the page in your application where the file upload step needs to occur. Make sure the Rec button is on.
- Click on the "file upload" or "choose file" button in your application.
- When the system dialogue appears, select the file you would like to upload from your computer.
The maximum filename limit is 255 ASCII characters.
However, if the filename includes non-ASCII characters the limit may be as low as 84 characters, depending on character encoding and the 255 bytes available for filenames.
- Click Open. The Trainer will automatically record a step that sets the file input: "Set file input to <name-of-file>.
- Record the action to submit the file upload in your application. For example, click on the submit button.
- Create an assertion to confirm the upload was successful. This assertion will depend on what happens in the application after a successful file upload.
In most cases, mabl needs to interact with a file-type input element. When you record a file upload step, mabl will record a click step to open the system dialog. This step is not necessary for replaying the test in the mabl Trainer or for running the test in the cloud, and it can be deleted.
Updating file input
To update the file input, click on the pencil icon next to the recorded file upload step. You can choose a new file input from the dropdown.
If you want to use a new file input that has not been uploaded in the mabl application, delete the existing file upload step and record a new upload step with new file input.
Managing file uploads
In order to view and manage the files that have been uploaded to tests in your workspace, you can visit the file uploads page: Configuration > File uploads.
How large of a file can I upload?
By default, file uploads are supported up to 15 megabytes.
Support for large file uploads up to 100 MB is currently available as an early access program. To enable this feature, toggle on "Enable Large File Uploads" in the Labs page: Settings > Labs. Uploading a file greater than 15MB requires the ability to connect to Google Cloud Storage.
Prior to general availability, functionality is subject to change. We highly encourage early access participants to share feedback with their customer success manager or in the mabl Product Portal.
Do file upload steps appear in replay mode?
Yes, when you edit a test that contains a file upload step in the mabl Trainer, the Trainer downloads the file to your local computer. Then, during replay, the Trainer accesses that file to complete the upload replay steps.
Mabl cannot interact with the dialog box for selecting file input during Trainer replay or local test runs. This dialog box is part of the operating system, not the browser, and it can only be dismissed manually.
Will file upload work for drag-and-drop selection?
No, this functionality is not currently supported.
Can I select multiple files at the same time during training?
No, mabl is not able to pick up multiple files selected simultaneously as of now. You need to select the files one at a time to ensure that they are properly selected.
Can I delete a file from a file upload step?
Use the delete icon to delete file upload steps from the mabl Trainer and the file uploads page.
- If a file is used in tests, the delete button will be disabled on the file uploads page. You cannot delete a file that is used in a test.
- If you see a warning icon next to the file, you should confirm that the file isn't used in any tests or flows before deleting. (See more information on this in the next question.)
What does it mean if I see a yellow warning icon next to my file in the file uploads page?
If you see a warning icon next to a file on the file uploads page, it means that mabl could not determine whether the file was referenced in a test or flow. If you delete a file that is still referenced in a test or flow, you will not be able to open the test in the mabl Trainer, and the step will fail when run locally or in the cloud. If you are unable to open a test because of a deleted file input, contact mabl support.
Why are my files stored in the mabl cloud?
When you record a file upload, mabl automatically captures the file and stores it in the mabl cloud. We need to store these uploads for later test runs so that mabl will be able to perform these uploads during tests.
May I use the same file name with different content in different tests?
Yes. After training the tests, the file uploads page will show you which test a particular file upload belongs to even if they share the same file name.
Under which browsers can I test file uploads in tests?
File uploads are available in all supported browsers.
Are my files secure?
Yes, mabl automatically captures the files used during training and stores them in your workspace-encrypted bucket for use while running tests. You can read more about encryption details here.
How long does mabl retain file uploads in the mabl cloud?
File uploads remain in the mabl cloud until you choose to delete them.