Playwright · Method
page.getByLabel
getByLabel() returns a locator for an input using its associated label, aria-labelledby text, or aria-label. It accepts a string or regular expression.
Last updated
- Since
- v1.27
Syntax
page.getByLabel(text, options?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByRolegetByPlaceholdergetByTextgetByTestIdlocatorfill