When the Browser File Picker Breaks an Automated Upload
Diagnose file chooser timeouts by separating picker, selection and verified attachment state before retrying.
TL;DR: A file upload crosses three boundaries: opening the chooser, selecting an approved file, and confirming that the application kept the right attachment. A successful click proves only the first action was attempted. Test each boundary separately, preserve the first mismatch, and treat an interrupted or ambiguous upload as unknown until an independent readback resolves it.
A support agent attaches a fake invoice to a test ticket. The automation clicks Choose file, then waits. A native file picker appears, but the automation times out. Is the application broken? Is the browser tool missing an event? Did the file upload anyway?
Those are different failures with different owners. Repeating the click without answering them can open another chooser or create a duplicate attachment. A screenshot of the final page cannot tell you which boundary failed.
This guide gives QA and engineering a way to isolate the handoff, compare a native selection with an automated one, and decide whether an upload really passed. The example is a proposed test, not a claimed experiment.
Why a File Picker Is a Special Boundary
A web page can trigger a file picker, but selecting a local file also involves the browser, the operating system, and the permissions of the tool controlling them. The page and the automation do not necessarily observe that transition in the same way.
In one public Codex issue, a reporter described a native macOS picker opening while an extension-connected browser session timed out waiting for Playwright's filechooser event. The reporter said manual selection worked. That is a report about a specific configuration, not proof that all Chrome uploads or current versions fail in the same way.
A separate Playwright MCP issue documents a different boundary: in the reporter's tested version, clicking a chooser trigger and supplying a file were separate tool calls, and unrelated page tools were blocked while the chooser was pending. A contributor recommended the two-step flow; the proposed combined action was closed as not planned. Treat that as version-specific evidence, not a statement about every agent framework.
The common lesson is operational: the visible picker, the automation's chooser state, and the application's attachment are separate observations.
Work Through a Fake Invoice Upload
Suppose the product requirement is: a support user can attach one permitted PDF to the correct test ticket and find it after reopening the ticket. Use a disposable test environment, a synthetic PDF named invoice-test.pdf, and a test ticket with no attachments. Do not use customer files.
Before running, record the application build, browser and OS versions, automation tool and version, account role, ticket ID, fixture name, and expected initial attachment count. Note whether choosing a file uploads immediately or whether the app requires a separate submit action. Agree on a read-only way to check the final attachment count and content, such as reopening the ticket and opening the attachment, or an authorized test API.
Run the following two paths from equivalent clean ticket states. If the application makes a new ticket ID for each run, record the mapping; don't compare different starting data as if it were identical.
Step | Native control path | Automated path | What to inspect |
|---|---|---|---|
Open | Click the upload control and confirm the picker appears. | Trigger the same control using the tool's documented flow. | Did the control open a chooser? Did the tool report a pending chooser or an error? |
Select | Select the synthetic PDF through the picker. | Supply the same authorized fixture through the tool's file-selection interface. | Did the application show the intended filename or preview? |
Commit | Complete the app's explicit upload or save step if required. | Perform that same step once if required. | Was there an error, pending state, or acknowledgement? |
Verify | Reopen the test ticket or use the approved read-only check. | Do the same independent readback. | Is exactly one intended attachment present on the correct ticket, and can its content be opened? |
A filename or thumbnail is useful evidence, but it may only describe a selection or preview. A successful tool response may mean the command was accepted, not that the application stored the file. For this scenario, a pass requires the correct attachment on the correct ticket after the operation settles, with the content checked where permissions allow. If the readback is unavailable, record unknown, not pass.
The native path is a comparison control, not a universal truth machine. If it passes and automation fails, investigate the automation handoff first; the app could still have a tool-specific integration problem. If both fail, investigate the shared application and environment path. If neither reaches a reliable readback, the result remains unresolved.
Find the First Broken Handoff
Use the earliest observation that differs from the expected path to choose the next investigation.
The control does not open a chooser. Check the target, whether the control is enabled, the starting page state, and any application error. Confirm the same control manually before deciding it is an automation defect.
A chooser appears but the tool cannot see or resolve it. Preserve the tool error and pending state. Check whether this connection mode supports chooser interception and whether the tool is waiting for the correct event. Don't assume a longer timeout will fix an incompatible handoff.
The file is selected but the app shows an error or no expected preview. Check the permitted fixture, client validation, app state, and any relevant sanitized request or console evidence. A preview is not necessarily proof of persistence.
The app acknowledges the upload but readback is missing, wrong, or duplicated. Check the correct ticket, settle time, server response, and authorized durable readback. Keep the first outcome and any later retry separate.
A pending chooser is a state to resolve, not permission to start clicking around it. Use the active tool's documented cancellation or recovery procedure only when you know which chooser you own. If ownership or the upload outcome is uncertain, stop and ask a human to inspect it. After an ambiguous submission, read back the ticket before retrying; otherwise a second attempt can create a duplicate.
Choose the Right Automated Path
For a Playwright test that has access to the actual file input, the official upload documentation describes setInputFiles() on that input. For an input created dynamically, it shows registering the filechooser wait before triggering the control, then setting files on the resulting chooser.
These are different test paths. Setting a file input directly can exercise application behavior after selection, but it does not establish that a person can use the operating system's picker. Keep a native-picker check when the supported workflow depends on it. Conversely, an automated chooser event working in one browser connection does not establish that every extension-connected or remote session exposes the same event.
Test the product's error paths too:
Cancel: Open the picker and cancel it. Check that the product remains usable and that no unintended attachment appears.
Reselect: Choose the same file again and check the behavior the product intends. The HTML standard allows the browser to treat reselecting the same files as a dismissal or a selection change. Do not assume every browser will fire the same sequence.
Reject: Try an intentionally unsupported synthetic file in the test environment. The HTML
acceptattribute is a picker hint, not file validation; MDN recommends server-side validation. Check the resulting application behavior and that no unwanted attachment was saved.Interrupt: If the operation can be interrupted safely, stop at a defined boundary, then inspect the ticket before any retry. Record whether the result is absent, present, duplicated, or unknown.
These cases are not a substitute for the team's actual supported-browser and device matrix. That guide uses an attachment as a release-planning example; this investigation goes deeper on the chooser handoff and the owner of the first mismatch.
Make the Handoff Useful to an Agent
As teams ask agents to investigate browser failures, an upload report needs more than “the picker hung.” The browser-agent testing guide explains the broader task contract; for this file handoff, give the receiving person or permitted agent these specific details:
The test environment, tool and browser versions, account role, target ticket, and starting attachment count.
The synthetic fixture's safe identifier and intended destination. Keep actual file contents and local paths out of broadly shared reports unless sharing is explicitly authorized.
The ordered actions, including whether the chooser was opened, selected, canceled, or left pending.
The expected result, first observed mismatch, error text, and the exact boundary where evidence ends.
The independent attachment readback and any retry outcomes, recorded separately.
The permitted next action: inspect only, resolve an owned chooser, or perform one approved test retry after readback. Escalate unknown ownership or possible external side effects to a human.
This is preparation for an agent-ready workflow, not a claim that an agent can reconstruct the local file, diagnose the cause, or repair the app from a recording. A future replayable test artifact should carry the ordered actions, state transitions, expected and actual results, controls, permissions, and verified readback together. Today, preserve what you can and label missing evidence.
Preserve the Browser Path Without Overclaiming
For a permitted fake-data run, start a deliberate recording before opening the upload control, then stop and review it after the first mismatch. Try CSS Selector & XPath Finder by Samelogic to capture the browser steps and relevant page context for the teammate investigating the handoff. Add the separately observed chooser state and attachment readback; do not assume the native picker or the local file is captured or replayable.
A previous Samelogic fake-data QA run found that immediate outcomes could be associated with the wrong action. That report did not establish a fix. Review the recording against independent evidence, and do not use it as merge evidence until the relevant behavior is fixed and reverified. The recording supports the investigation; it does not prove the upload succeeded or replace the final readback.
Sources
Related workflows
Move from editorial context into the selector, Playwright, and bug-reproduction pages that turn exact UI evidence into action.

