Skip to content
masterclass Buddy

Playwright · Method

page.waitForSelector

page.waitForSelector waits for an element matched by a selector to reach a state such as visible, hidden, attached, or detached. It returns immediately when the condition is already true and throws if the timeout expires.

Last updated

Since
before v1.9

Syntax

page.waitForSelector(String selector, Page.WaitForSelectorOptions options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Locator.waitFor
  • Page.WaitForSelectorOptions
  • WaitForSelectorState

Source: Page | Playwright Java. Checked 2026-11-03.