Playwright · Method
page.focus
Use locator.focus() to move keyboard focus to an element. It helps test pages that change behavior when an element receives focus.
Last updated
Syntax
locator.focus()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Page.focusLocatorPage.get_by_label