Skip to main content
SeleniumDecoded
All Chapters Chapter 5

Advanced Features

iFrames, windows, alerts, uploads, Shadow DOM, cookies, WebAuthn, PDF printing, and JavaScript execution

  1. 1

    iFrames and Frames

    Learn to switch between frames and iframes to interact with embedded content.

    Selenium 3 & 4 Stable
  2. 2

    Windows and Tabs

    Handle multiple browser windows and tabs, switch between them, and manage popup windows.

    Selenium 3 & 4 Stable
  3. 3

    Alerts and Popups

    Handle JavaScript alerts, confirms, prompts, and authentication dialogs.

    Selenium 3 & 4 Stable
  4. 4

    File Uploads

    Handle file uploads in Selenium tests by interacting with file input elements.

    Selenium 3 & 4 Stable
  5. 5

    JavaScript Executor

    Execute JavaScript directly in the browser for advanced interactions and DOM manipulation.

    Selenium 3 & 4 Medium
  6. 6

    Shadow DOM

    Access and interact with elements inside Shadow DOM using Selenium's shadow root methods.

    Selenium 4 Stable
  7. 7

    Cookies, Local Storage and Session Storage

    Read, add and delete cookies, reuse a login session across tests, inspect localStorage and sessionStorage, and understand the domain and secure-flag rules that make cookie injection fail.

    Selenium 3 & 4 Stable
  8. 8

    Virtual Authenticator (WebAuthn and Passkeys)

    Test passwordless and two-factor flows by emulating a FIDO2/WebAuthn authenticator: create it, add resident and non-resident credentials, simulate user verification, and clean up.

    Selenium 4 Medium
  9. 9

    Printing Pages to PDF

    Generate PDFs of any page with the W3C print command: orientation, scale, page ranges, margins, backgrounds, and how to assert on the PDF's contents in your tests.

    Selenium 4 Stable
  10. 10

    Testing File Downloads

    Set download folders in Chrome, Edge and Firefox, wait for downloads to finish, use the Selenium Grid downloads API, and verify file contents, not just names.

    Selenium 4 Stable
  11. 11

    Loading Browser Extensions

    Install browser extensions in Selenium: Firefox installAddon, Chrome packed and unpacked extensions, the BiDi webExtension module, and the 4.50 removals.

    Selenium 4 Medium