Playwright · Method
page.getByText
page.getByText locates elements using their text. It supports substring matching, exact matching, and regular expressions.
Last updated
- Since
- v1.27
Syntax
Page.GetByText(string text, PageGetByTextOptions? options = null)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Locator.FilterGetByRoleGetByLabelGetByTitleGetByTestId