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:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →