Skip to main content
Page queries methods for the Playwright driver.

$

Query for a single element. Alias for page.querySelector().
Deprecated: Use locator() instead.
Upstream docs
selector
string
required
result
RemotePlaywrightElementHandle | null
Return value
await page.$('...');

$$

Query for all matching elements. Alias for page.querySelectorAll().
Deprecated: Use locator() instead.
Upstream docs
selector
string
required
result
RemotePlaywrightElementHandle[]
Return value
await page.$$('...');

querySelector

Query for a single element.
Deprecated: Use locator() instead.
Upstream docs
selector
string
required
result
RemotePlaywrightElementHandle | null
Return value
await page.querySelector('...');

querySelectorAll

Query for all matching elements.
Deprecated: Use locator() instead.
Upstream docs
selector
string
required
result
RemotePlaywrightElementHandle[]
Return value
await page.querySelectorAll('...');

locator

Create a locator for the given selector. Upstream docs
selector
string
required
options
PlaywrightLocatorOptions
result
RemotePlaywrightLocator
Return value
await page.locator('...');

getByRole

Locate elements by their ARIA role, ARIA attributes, and accessible name. Upstream docs
role
string
required
options
PlaywrightGetByRoleOptions
result
RemotePlaywrightLocator
Return value
await page.getByRole('...');

getByText

Locate elements containing the given text. Upstream docs
text
string | RegExp
required
options
PlaywrightGetByTextOptions
result
RemotePlaywrightLocator
Return value
await page.getByText(/* string | RegExp */);

getByLabel

Locate form controls by the text of their associated labels. Upstream docs
text
string | RegExp
required
options
PlaywrightGetByLabelOptions
result
RemotePlaywrightLocator
Return value
await page.getByLabel(/* string | RegExp */);

getByPlaceholder

Locate input elements by their placeholder text. Upstream docs
text
string | RegExp
required
options
PlaywrightGetByPlaceholderOptions
result
RemotePlaywrightLocator
Return value
await page.getByPlaceholder(/* string | RegExp */);

getByAltText

Locate elements by their alt text. Upstream docs
text
string | RegExp
required
options
PlaywrightGetByAltTextOptions
result
RemotePlaywrightLocator
Return value
await page.getByAltText(/* string | RegExp */);

getByTitle

Locate elements by their title attribute. Upstream docs
text
string | RegExp
required
options
PlaywrightGetByTitleOptions
result
RemotePlaywrightLocator
Return value
await page.getByTitle(/* string | RegExp */);

getByTestId

Locate elements by their data-testid attribute. Upstream docs
testId
string | RegExp
required
result
RemotePlaywrightLocator
Return value
await page.getByTestId(/* string | RegExp */);

frameLocator

Create a frame locator for the given selector. Upstream docs
selector
string
required
result
RemotePlaywrightLocator
Return value
await page.frameLocator('...');