Skip to main content

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
It feels like an impossible test to automate. So you skip it and test manually instead. But here’s the thing: In Autonoma, file uploads are just another action. No special code. No complicated setup. Just a simple two-step process that works every time. This guide shows you exactly how to test file uploads in Autonoma—and why it’s easier than you think.

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)
None of these are satisfying. The first two don’t test what users actually experience. The last one defeats the purpose of automation.

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 like test-profile-picture.jpg. Step 2: Build your navigation Start by navigating to the profile page:
Test: "Upload profile picture"

1. Navigate to {{variable:APP_URL}}/profile
2. Wait until: Profile page loads
Standard test building so far. Now comes the upload. Step 3: Upload the file in Autonoma In the Autonoma interface, click the “Upload File” option (in the canvas controls). Select your 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:
3. Click "Choose File" button
When this step runs, your application will open the file picker dialog. But because you already uploaded the file to Autonoma, Autonoma automatically provides that file to the dialog. No manual interaction needed. Step 5: Verify and save Add verification:
4. Wait until: Profile picture preview appears
5. Click "Save" button
6. Wait until: Success message appears
That’s it. Your file upload test is complete.

The Complete Test

Here’s what the full test looks like:
Test: "Upload profile picture"

1. Navigate to {{variable:APP_URL}}/profile
2. Wait until: Profile page loads
3. Upload file: test-profile-picture.jpg ← Uploaded in Autonoma first
4. Click "Choose File" button ← Then click in your app
5. Wait until: Profile picture preview appears
6. Click "Save" button
7. Wait until: Success message appears
Order matters: Upload file in Autonoma (step 3) before clicking the button in your app (step 4).

Testing Different File Types

The same approach works for any file type: Resume upload:
Test: "Submit job application with resume"

1. Navigate to {{variable:APP_URL}}/careers/apply
2. Wait until: Application form loads
3. Type {{variable:TEST_NAME}} in "Full Name" field
4. Type {{variable:TEST_EMAIL}} in "Email" field
5. Upload file: test-resume.pdf ← PDF file
6. Click "Upload Resume" button
7. Wait until: Resume filename appears
8. Click "Submit Application"
9. Wait until: "Application received" message appears
Bulk document upload:
Test: "Upload multiple documents"

1. Navigate to {{variable:APP_URL}}/documents
2. Wait until: Document manager loads
3. Upload file: invoice-001.pdf ← First file
4. Click "Add Invoice" button
5. Wait until: First invoice appears in list
6. Upload file: invoice-002.pdf ← Second file
7. Click "Add Invoice" button
8. Wait until: Second invoice appears in list
CSV import:
Test: "Import customer data via CSV"

1. Navigate to {{variable:APP_URL}}/admin/import
2. Wait until: Import page loads
3. Upload file: test-customers.csv ← CSV file
4. Click "Choose CSV File" button
5. Wait until: File name displays
6. Click "Import Data" button
7. Wait until: "Imported 10 customers" message appears

Common Patterns

After you’ve built a few upload tests, you’ll notice these patterns: Pattern 1: Upload → Click → Verify
1. Upload file in Autonoma
2. Click upload button in app
3. Wait for confirmation
Most upload tests follow this sequence. Pattern 2: Fill Form → Upload → Submit
1. Fill out form fields
2. Upload file
3. Click upload button
4. Complete form submission
Common for applications, job postings, support tickets. Pattern 3: Multiple Uploads
1. Upload file 1
2. Click upload button
3. Wait for confirmation
4. Upload file 2
5. Click upload button
6. Wait for confirmation
For features that accept multiple files.

Important Notes

Web only: File uploads in Autonoma currently work for web applications. Mobile app file upload testing is coming soon. File persistence: The file you upload is stored with your test. When the test runs (even in CI/CD), that same file will be used. You don’t need to set up files in your CI environment. File size: Keep test files reasonably small (under 10MB). Large files slow down test execution and aren’t necessary for validating upload functionality. Real validation: This tests the actual upload flow your users experience—not a mock or simulation. The file goes through your real upload logic, validation, and storage.

What’s Next

Now you know how to test file uploads—a feature that seems impossible in most testing tools but is straightforward in Autonoma. Next, let’s explore another powerful capability: teaching your tests to remember and reuse information from your application.