Skip to content
masterclass Buddy

Playwright · Method

locator.hover

Playwright locators find elements when actions or assertions run. Prefer built-in locators, especially roles with accessible names, because they match how users and assistive technology perceive the page.

Last updated

Syntax

page.get_by_role(role, name=None)

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

Subscribe
  • page.get_by_role()
  • page.get_by_label()
  • page.get_by_text()
  • page.get_by_placeholder()
  • page.get_by_test_id()
  • locator.all()
  • FrameLocator

Source: Locators | Playwright Python. Checked 2026-11-03.