Skip to main content
Frame content methods for the Playwright driver.

textContent

Returns the element.textContent.
Discouraged: use locator-based locator.textContent() instead.
Upstream docs
selector
string
required
options
PlaywrightTextContentOptions
result
string | null
Return value
await frame.textContent('...');

innerText

Returns the element.innerText.
Discouraged: use locator-based locator.innerText() instead.
Upstream docs
selector
string
required
options
PlaywrightInnerTextOptions
result
string
Return value
await frame.innerText('...');

innerHTML

Returns the element.innerHTML.
Discouraged: use locator-based locator.innerHTML() instead.
Upstream docs
selector
string
required
options
PlaywrightInnerHTMLOptions
result
string
Return value
await frame.innerHTML('...');

getAttribute

Returns element attribute value.
Discouraged: use locator-based locator.getAttribute() instead.
Upstream docs
selector
string
required
name
string
required
options
PlaywrightGetAttributeOptions
result
string | null
Return value
await frame.getAttribute('...', '...');

inputValue

Returns input.value for the selected <input> or <textarea> or <select> element.
Throws for non-input elements. Discouraged: use locator-based locator.inputValue() instead.
Upstream docs
selector
string
required
options
PlaywrightInputValueOptions
result
string
Return value
await frame.inputValue('...');