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.URL to navigate to
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.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.Load state to wait for (default: ‘load’)
Timeout options
Promise<void>
waitForURL
Waits for URL to match pattern.URL pattern to wait for
Wait options
Promise<void>
Selector Methods
$
Finds an element.Selector to query
strict(boolean): Throw if multiple elements match
Promise<ElementHandle | null> - Element handle or null
$$
Finds all elements.Selector to query
Promise<ElementHandle[]> - Array of element handles
waitForSelector
Waits for element to appear.Selector to wait for
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.Selector to locate
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.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.HTML content to set
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 to evaluate
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.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.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.Timeout in milliseconds
Promise<void>
waitForFunction
Waits for function to return truthy value.Function to evaluate
Argument to pass
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
