Testing file uploads in your mobile app is an important part of ensuring a more seamless user experience. In the mabl Trainer, you can train a file upload scenario for your mobile app in two steps:
Push the file to your device
Before training a file upload, you must first push the file to the virtual device with a "Push file" step:
- Click on the plus sign to add a new step.
- Select Push file(s).
- Select a file. Android tests support pushing any file type, while iOS tests only support pushing photos, live photos, videos, or contacts:
- Choose + Add files to push a new file to the mabl cloud.
- Choose Select files to choose a file that's already uploaded to your mabl workspace.
- If you want to push the file to a different path, update the Device path field. Specifying a device path is only supported for Android tests.
- Click OK to push the file to your device.
The maximum supported file size is 100 MB.
If you add a new file, it will be securely uploaded to mabl and will be visible from the file uploads page: Configuration > File uploads.
Adding a new file to the mabl cloud
Upload the file to your app
After adding the file to the virtual device, you can upload the file to your app:
- Navigate to the view in your application where the file upload needs to occur.
- Make sure the Rec button is turned on.
- Click on the button in your application to select a file.
- Select the file that you uploaded in the "push file" step. Mabl automatically records a "Set file input to <name-of-file>" step.