TOPIC 35/4016 MINNOT STARTED

Selenium: mouse and keyboard actions, dropdowns and file upload

Some page controls need more than a click. Learn how to use the Actions API, pick from a dropdown and upload a file in a Selenium test.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a snack machine. Some machines need only a button press. Others need you to hold a key, choose a row and drop in a coin, in the right order.

The machine does nothing until all the steps are done.

The builds those steps. Tom, the tester at Daily List, a to-do list app, uses it for controls that need more than a click. The skill is to pick the right tool for each control and then wait for the result.

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB A snack machine that needs a few steps in order.

  1. Build
  2. Perform
  3. Wait
Snack machine

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
Holding a keyPressing a key down
Choosing a rowPicking a dropdown option
Dropping a coinSending the file path
Waiting for the snackWaiting for the result

WHERE THIS PICTURE STOPS

  • A machine has fixed buttons, but a page control can be custom built.
  • A coin is real, but a file path is only text.
  • A machine gives a snack, but a test checks the page.

HOOK

Chain the steps, then wait.

TELL A FRIEND

A snack machine: do the steps in order, then wait.

OFTEN MIXED UP WITH Selenium WebDriver: your first small suite. That topic builds the first Selenium suite. This one handles controls that need more than a click.

PRACTISE AND KEEP

Sources for this topic — 3 sources
  1. Market practice

    Interacting with web elements (Selenium documentation) ↗ — Selenium · Selenium documentation: the basic element commands are click, send keys, clear, submit and select, and each applies only to some element types (search excerpt, page not opened)

    The official page listing the basic element commands: click, send keys, clear, submit and select. Official project documentation. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    File upload (Selenium documentation) ↗ — Selenium · Selenium documentation: a test cannot drive the native file dialog, so it sends the full file path to the file input and then submits (search excerpt, page not opened)

    The official page saying the native file dialog cannot be driven, so a test sends the file path to the file input. Official project documentation. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    Mouse actions (Selenium documentation) ↗ — Selenium · Selenium documentation: the Actions API builds mouse actions such as hover and drag and drop, and runs them with a perform call (search excerpt, page not opened)

    The official page on the Actions API for mouse moves, hover and drag and drop. Official project documentation. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.