lecture 19 of 220 completed

Uploading files

The file picker belongs to the operating system and cannot be clicked. The way around it is one line, and it surprises people.

What you'll learn

  • Why the file picker cannot be clicked
  • How to attach a file directly to the input
  • What to assert after an upload

Click "Browse" in a test and the operating system's file picker opens. It is not a web page, it has no DOM, and no browser automation tool can click it. This is a real limit, not a gap in Selenium.

The way around it is short enough to be surprising:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →