Testing File Uploads
The Impossible Test
You’re building tests for your application’s profile page. Everything works great—you can click fields, type information, submit forms. Then you hit the profile picture upload feature. You stare at it. How are you supposed to test this? In traditional testing tools, file uploads are notoriously difficult. You need to:- Deal with operating system file dialogs
- Mock file system access
- Write special code to bypass browser security
- Hope it works across different environments
Why File Uploads Seem Hard
Let’s understand why file uploads feel different from other test actions. When you click a “Choose File” button on a website, something unique happens: The browser opens an operating system dialog. This dialog lives outside the web page—it’s part of your computer’s file system. Traditional testing tools run inside the browser. They can click buttons and type text on web pages. But they can’t interact with your operating system’s file picker. It’s a security boundary they can’t cross. So developers resort to workarounds:- Inject files directly into form fields (bypassing the UI)
- Mock the entire upload process (not testing reality)
- Manually test every time (slow and inconsistent)
How Autonoma Solves This
Autonoma takes a different approach. Instead of trying to interact with the file dialog after it opens, you upload the file in Autonoma before clicking the button. Here’s the mental model: Traditional tools: Click button → File dialog opens → ??? (can’t interact) Autonoma: Upload file → Click button → File automatically selected ✓ It’s like pre-loading the answer before the question is asked. When the file dialog opens, Autonoma already knows which file to provide.Testing Your First Upload
Let’s build a real test. You’re testing a profile page where users can upload a profile picture. Step 1: Set up your file Before you start building your test, prepare a test image. Save a small image file (PNG or JPG) somewhere on your computer. You’ll use this for all your test runs. Name it something clear liketest-profile-picture.jpg.
Step 2: Build your navigation
Start by navigating to the profile page:
test-profile-picture.jpg file.
This is the key moment. You’ve uploaded the file to Autonoma before interacting with your application. Autonoma now has the file ready.
Step 4: Click the upload button in your app
Now add the step that clicks your application’s file upload button:

