lecture 1 of 180 completed

Waits, and the mistake that hides in them

Explicit waits are the right tool. Mixing them with implicit waits creates timing bugs that are very hard to find.

What you'll learn

  • Why explicit waits are the right tool
  • What goes wrong when implicit and explicit waits are mixed
  • How to remove an inherited implicit wait safely

A test should fail after 5 seconds. It waits for a delay notice that never appears. You run it, and it fails after 10 seconds. You change the wait to 15 seconds, and now it fails after 20. Nothing in the test explains the extra time.

This is one of the most confusing timing bugs in Selenium projects. It comes from two kinds of waiting that do not work well together.

Reading example. Harbour Ferries is a fictional ferry timetable app. You can read these examples here.

An implicit wait is a global setting for the whole session. Every time Selenium looks for an element, it keeps looking for up to this long before it gives up:

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 →