Playwright · Method
locator.filter
locator.filter() narrows an existing Playwright locator by text or by matching or excluding descendants. You can chain filters to identify one element without relying on position.
Last updated
- Since
- v1.22
Syntax
locator.filter(options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
LocatorLocator.locatorLocator.getByRoleLocator.getByTextLocator.getByTestIdLocator.all