Skip to content
masterclass Buddy

Playwright · Method

locator.innerText

locator.innerText() returns the rendered text of the element matched by a locator. Use it when you need the element's visible text.

Last updated

Since
v1.14

Syntax

await locator.innerText(options);

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

Subscribe
  • allInnerTexts
  • allTextContents
  • textContent
  • toHaveText

Source: Locator | Playwright. Checked 2026-11-03.