Inheritance
Extends:ChannelOwner
Methods
page
Returns the parent page.Page - Parent page
name
Returns frame name.string - Frame name attribute
url
Returns frame URL.string - Frame URL
parentFrame
Returns parent frame.Frame | null - Parent frame or null for main frame
childFrames
Returns child frames.Frame[] - Array of child frames
isDetached
Checks if frame is detached.boolean - True if detached
frameElement
Returns the frame element handle.Promise<ElementHandle> - Frame element (iframe)
Navigation Methods
goto
Navigates to a URL.string
required
URL to navigate to
GotoOptions
Navigation options
timeout(number): Maximum time in millisecondswaitUntil(‘load’ | ‘domcontentloaded’ | ‘networkidle’ | ‘commit’): When to consider navigation succeededreferer(string): Referer header
Promise<Response | null> - Response
waitForNavigation
Waits for navigation.WaitForNavigationOptions
Wait options
url(string | RegExp): URL pattern to wait forwaitUntil(string): Wait conditiontimeout(number): Maximum time
Promise<Response | null> - Response
waitForLoadState
Waits for load state.string
Load state to wait for (default: ‘load’)
TimeoutOptions
Timeout options
Promise<void>
waitForURL
Waits for URL to match pattern.string | RegExp
required
URL pattern to wait for
WaitForURLOptions
Wait options
Promise<void>
Selector Methods
$
Finds an element.string
required
Selector to query
object
strict(boolean): Throw if multiple elements match
Promise<ElementHandle | null> - Element handle or null
$$
Finds all elements.string
required
Selector to query
Promise<ElementHandle[]> - Array of element handles
waitForSelector
Waits for element to appear.string
required
Selector to wait for
WaitForSelectorOptions
Wait options
state(‘attached’ | ‘visible’ | ‘hidden’ | ‘detached’): Element state to wait fortimeout(number): Maximum timestrict(boolean): Throw if multiple elements match
Promise<ElementHandle | null> - Element handle or null
locator
Creates a locator.string
required
Selector to locate
LocatorOptions
Locator options
Locator - Locator instance
getByRole
Creates a locator by ARIA role.getByText
Creates a locator by text.getByLabel
Creates a locator by label.getByPlaceholder
Creates a locator by placeholder.getByAltText
Creates a locator by alt text.getByTitle
Creates a locator by title.getByTestId
Creates a locator by test ID.frameLocator
Creates a frame locator.string
required
Frame selector
FrameLocator - Frame locator instance
Action Methods
click
Clicks an element.dblclick
Double clicks an element.fill
Fills an input.type
Types text.press
Presses a key.check
Checks a checkbox.uncheck
Unchecks a checkbox.setChecked
Sets checkbox state.selectOption
Selects options.hover
Hovers over element.tap
Taps an element.dragAndDrop
Drags and drops.focus
Focuses an element.setInputFiles
Sets input files.dispatchEvent
Dispatches a DOM event.Content Methods
content
Returns HTML content.Promise<string> - Full HTML content
setContent
Sets HTML content.string
required
HTML content to set
SetContentOptions
Set content options
Promise<void>
title
Returns page title.Promise<string> - Page title
textContent
Returns element’s text content.innerText
Returns element’s inner text.innerHTML
Returns element’s inner HTML.getAttribute
Returns attribute value.inputValue
Returns input value.State Methods
isVisible
Checks if visible.isHidden
Checks if hidden.isEnabled
Checks if enabled.isDisabled
Checks if disabled.isChecked
Checks if checked.isEditable
Checks if editable.Evaluation Methods
evaluate
Evaluates JavaScript.Function | string
required
Function to evaluate
any
Argument to pass
Promise<R> - Evaluation result
evaluateHandle
Evaluates and returns JSHandle.$eval
Evaluates on an element.$$eval
Evaluates on multiple elements.Script Methods
addScriptTag
Adds a script tag.object
required
Script options
url(string): Script URLpath(string): Path to script filecontent(string): Script contenttype(string): Script type
Promise<ElementHandle> - Script element handle
addStyleTag
Adds a style tag.object
required
Style options
url(string): Stylesheet URLpath(string): Path to stylesheet filecontent(string): CSS content
Promise<ElementHandle> - Style element handle
Wait Methods
waitForTimeout
Waits for timeout.number
required
Timeout in milliseconds
Promise<void>
waitForFunction
Waits for function to return truthy value.Function | string
required
Function to evaluate
any
Argument to pass
WaitForFunctionOptions
Wait options
timeout(number): Maximum timepolling(number | ‘raf’): Polling interval
Promise<JSHandle<R>> - JS handle
Usage Examples
Working with Frames
Interacting with Frame Content
Frame Locators
Related Classes
- Page - Parent page
- Locator - Element locators
- ElementHandle - Element handles
- FrameLocator - Frame locators
