sdk/src/playwright.ts
Export Index
| Export | Kind | Source | Notes |
|---|---|---|---|
LocatorChainStep | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightBoundingBoxResult | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightBrowser | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightBrowserContext | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightCheckOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightClickOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightFillOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightFocusOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetAttributeOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByAltTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByLabelOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByPlaceholderOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByRoleOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByTitleOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGoBackOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGoForwardOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGotoOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightHoverOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInnerHTMLOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInnerTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInputValueOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightIsOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightKeyboard | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightKeyboardOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightLocator | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightLocatorFilterOptions | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightLocatorOptions | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightMouse | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightMouseClickOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightMouseMoveOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightNewContextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightNewPageOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPage | interface | sdk/src/drivers/playwright/types.ts | - |
PlaywrightPageScreenshotOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPDFOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPressOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightReloadOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightScreenshotOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightSelectOptionOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightSession | class | sdk/src/drivers/playwright/session.ts | - |
PlaywrightTextContentOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightTypeOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForLoadStateOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForSelectorOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForURLOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
RemotePlaywrightAPIRequestContext | class | sdk/src/drivers/playwright/generated/api-request-context.ts | RemotePlaywrightAPIRequestContext - Remote Playwright APIRequestContext API over RPC. |
RemotePlaywrightAPIResponse | class | sdk/src/drivers/playwright/generated/api-response.ts | RemotePlaywrightAPIResponse - Remote Playwright APIResponse API over RPC. |
RemotePlaywrightBrowser | class | sdk/src/drivers/playwright/generated/browser.ts | RemotePlaywrightBrowser - Remote Playwright Browser API over RPC. |
RemotePlaywrightBrowserContext | class | sdk/src/drivers/playwright/generated/browser-context.ts | RemotePlaywrightBrowserContext - Remote Playwright BrowserContext API over RPC. |
RemotePlaywrightClock | class | sdk/src/drivers/playwright/generated/clock.ts | RemotePlaywrightClock - Remote Playwright Clock API over RPC. |
RemotePlaywrightConsoleMessage | class | sdk/src/drivers/playwright/generated/console-message.ts | RemotePlaywrightConsoleMessage - Remote Playwright ConsoleMessage API over RPC. |
RemotePlaywrightCoverage | class | sdk/src/drivers/playwright/generated/coverage.ts | RemotePlaywrightCoverage - Remote Playwright Coverage API over RPC. |
RemotePlaywrightDialog | class | sdk/src/drivers/playwright/generated/dialog.ts | RemotePlaywrightDialog - Remote Playwright Dialog API over RPC. |
RemotePlaywrightElementHandle | class | sdk/src/drivers/playwright/generated/element-handle.ts | RemotePlaywrightElementHandle - Remote Playwright ElementHandle API over RPC. |
RemotePlaywrightFrame | class | sdk/src/drivers/playwright/generated/frame.ts | RemotePlaywrightFrame - Remote Playwright Frame API over RPC. |
RemotePlaywrightJSHandle | class | sdk/src/drivers/playwright/generated/js-handle.ts | RemotePlaywrightJSHandle - Remote Playwright JSHandle API over RPC. |
RemotePlaywrightKeyboard | class | sdk/src/drivers/playwright/generated/keyboard.ts | RemotePlaywrightKeyboard - Remote Playwright Keyboard API over RPC. |
RemotePlaywrightLocator | class | sdk/src/drivers/playwright/generated/locator.ts | RemotePlaywrightLocator - Remote Playwright Locator API over RPC. |
RemotePlaywrightMouse | class | sdk/src/drivers/playwright/generated/mouse.ts | RemotePlaywrightMouse - Remote Playwright Mouse API over RPC. |
RemotePlaywrightPage | class | sdk/src/drivers/playwright/generated/page.ts | RemotePlaywrightPage - Remote Playwright Page API over RPC. |
RemotePlaywrightTouchscreen | class | sdk/src/drivers/playwright/generated/touchscreen.ts | RemotePlaywrightTouchscreen - Remote Playwright Touchscreen API over RPC. |
RemotePlaywrightTracing | class | sdk/src/drivers/playwright/generated/tracing.ts | RemotePlaywrightTracing - Remote Playwright Tracing API over RPC. |
RemotePlaywrightWorker | class | sdk/src/drivers/playwright/generated/worker.ts | RemotePlaywrightWorker - Remote Playwright Worker API over RPC. |
Classes
PlaywrightSession
Source:sdk/src/drivers/playwright/session.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
browser | RemotePlaywrightBrowser | getter • Get browser instance (Playwright API). |
browserContext | RemotePlaywrightBrowserContext | getter • Get default browser context (Playwright API). This is a synchronous getter that creates a context from the known context ID. |
context | PlaywrightContext | getter • Context for multi-page management (like stagehand.context). |
page | RemotePlaywrightPage | getter • Get default page (Playwright API). |
Methods
getDefaultContext
Get default context (Playwright API) - async version. Note: contexts() returns a Promise in this SDK.getPages
Get all pages (convenience method). Note: Returns a Promise since pages() is async.RemotePlaywrightAPIRequestContext
Source:sdk/src/drivers/playwright/generated/api-request-context.ts
Constructor
Methods
delete
Sends HTTP(S) DELETE request and returns its response.dispose
All responses returned by this context will be disposed of and no longer accessible.fetch
Sends HTTP(S) request and returns its response.get
Sends HTTP(S) GET request and returns its response.head
Sends HTTP(S) HEAD request and returns its response.patch
Sends HTTP(S) PATCH request and returns its response.post
Sends HTTP(S) POST request and returns its response.put
Sends HTTP(S) PUT request and returns its response.storageState
Returns storage state for this request context.RemotePlaywrightAPIResponse
Source:sdk/src/drivers/playwright/generated/api-response.ts
Constructor
Methods
body
Returns the buffer with response body.dispose
Disposes the body of this response.headers
An object with all the response HTTP headers associated with this response.headersArray
An array with all the response HTTP headers associated with this response.json
Returns the JSON representation of response body.ok
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.status
Contains the status code of the response (e.g., 200 for a success).statusText
Contains the status text of the response (e.g., “OK” for a success).text
Returns the text representation of response body.url
Contains the URL of the response.RemotePlaywrightBrowser
Source:sdk/src/drivers/playwright/generated/browser.ts
Constructor
Methods
browserType
Get the browser type name (chromium, firefox, or webkit) that was used to launch this browser.close
Closes the browser and all of its pages (if any were opened).contexts
Returns an array of all open browser contexts.isConnected
Indicates that the browser is connected.newBrowserCDPSession
Returns the newly created browser session.newContext
Creates a new browser context. It will not share cookies/cache with other browser contexts.newPage
Creates a new page in a new browser context. Closing this page will close the context as well.removeAllListeners
Removes all listeners for the specified event, or all events if no event is specified.startTracing
Starts Chromium Tracing.stopTracing
Stops Chromium Tracing and returns the trace data.version
Returns the browser version.RemotePlaywrightBrowserContext
Source:sdk/src/drivers/playwright/generated/browser-context.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
clock | RemotePlaywrightClock | getter • Playwright Clock API for mocking time. |
request | RemotePlaywrightAPIRequestContext | getter • API testing helper associated with this context. |
tracing | RemotePlaywrightTracing | getter • Tracing helper for recording execution traces. |
Methods
addCookies
Adds cookies into this browser context. All pages within this context will have these cookies installed.addInitScript
Adds a script which would be evaluated in one of the following scenarios: whenever a page is created in the context or navigated.addListener
backgroundPages
Returns all background pages in the context.browser
Returns the browser this context belongs to.clearCookies
Removes cookies from context. Accepts optional filter to remove specific cookies.clearPermissions
Clears all permission overrides for the browser context.close
Closes the browser context. All the pages that belong to the browser context will be closed.cookies
Returns cookies for the specified URLs, or all cookies if no URLs are specified.emit
exposeBinding
Adds a function called name on the window object of every frame in every page in the context.grantPermissions
Grants specified permissions to the browser context.listenerCount
newCDPSession
Returns the newly created CDP session attached to the given page.newPage
Creates a new page in the browser context.off
on
once
pages
Returns all open pages in the context.removeAllListeners
Removes all listeners for the specified event, or all events if no event is specified.removeListener
route
Routing provides the capability to modify network requests that are made by any page in the browser context.routeFromHAR
If specified, network requests that are made in the context will be served from the HAR file.routeWebSocket
Allows modifying WebSocket connections made by pages in the context.serviceWorkers
Returns all service workers in the context.setDefaultNavigationTimeout
Sets the default maximum navigation timeout.setDefaultTimeout
Sets the default maximum time for all methods accepting timeout option.setExtraHTTPHeaders
Sets extra HTTP headers that will be sent with every request in the context.setGeolocation
Sets the contexts geolocation. Passing null clears geolocation.setHTTPCredentials
Sets HTTP credentials for HTTP authentication.setOffline
Sets whether to emulate network being offline for the browser context.storageState
Returns storage state for this browser context.unroute
Removes a route created with browserContext.route(). When handler is not specified, removes all routes for the url.unrouteAll
Removes all routes created with browserContext.route() and browserContext.routeFromHAR().waitForEvent
Waits for event to fire and passes its value into the predicate function.RemotePlaywrightClock
Source:sdk/src/drivers/playwright/generated/clock.ts
Constructor
Methods
fastForward
Advances the clock by jumping forward in time.install
Install fake implementations for time-related functions.pauseAt
Advances the clock by jumping forward in time and pause the time.resume
Resumes timers that were paused.runFor
Advances the clock by specified time, firing all timers in the process.setFixedTime
Makes Date.now() and new Date() return a fixed fake time.setSystemTime
Sets current system time but does not trigger any timers.RemotePlaywrightConsoleMessage
Source:sdk/src/drivers/playwright/generated/console-message.ts
Constructor
Methods
args
List of arguments passed to a console function call.location
Source location of the console message.page
The page that produced this console message, if any.text
The text of the console message.type
The type of the console message.worker
The web worker or service worker that produced this console message, if any.RemotePlaywrightCoverage
Source:sdk/src/drivers/playwright/generated/coverage.ts
Constructor
Methods
startCSSCoverage
Starts CSS coverage collection.startJSCoverage
Starts JavaScript coverage collection.stopCSSCoverage
Stops CSS coverage collection and returns the coverage reports.stopJSCoverage
Stops JavaScript coverage collection and returns the coverage reports.RemotePlaywrightDialog
Source:sdk/src/drivers/playwright/generated/dialog.ts
Constructor
Methods
accept
Accepts the dialog.defaultValue
Returns the default prompt value if the dialog is a prompt.dismiss
Dismisses the dialog.message
Returns the message displayed in the dialog.page
Returns the page that initiated the dialog, or null if not available.type
Returns the type of the dialog.RemotePlaywrightElementHandle
Source:sdk/src/drivers/playwright/generated/element-handle.ts
Constructor
Methods
$
Query for a child element matching the selector.$$
Query for all child elements matching the selector.$$eval
Evaluate a function on all child elements matching the selector.$eval
Evaluate a function on a child element matching the selector.asElement
Return this handle as an ElementHandle. Since this is already an ElementHandle, returns itself.boundingBox
Get the bounding box of the element.check
Check a checkbox or radio element.click
Click the element.contentFrame
Get the content frame for iframe elements.dblclick
Double-click the element.dispatchEvent
Dispatch a DOM event on the element.dispose
Dispose of the handle, releasing it from the browser.evaluate
Evaluate a function in the context of the element.evaluateHandle
Evaluate a function and return a JSHandle to the result.fill
Fill an input, textarea, or contenteditable element with the specified value.focus
Focus the element.getAttribute
Get an attribute value of the element.getProperty
Get a JSHandle for a property of this element.hover
Hover over the element.innerHTML
Get the innerHTML of the element.innerText
Get the innerText of the element.inputValue
Get the input value for input, textarea, or select elements.isChecked
Check if a checkbox or radio is checked.isDisabled
Check if the element is disabled.isEditable
Check if the element is editable.isEnabled
Check if the element is enabled.isHidden
Check if the element is hidden.isVisible
Check if the element is visible.jsonValue
Get the JSON value of the element.ownerFrame
Get the frame that owns this element.press
Focus the element and press a key or key combination.scrollIntoViewIfNeeded
Scroll the element into view if not already visible.selectOption
Select one or more options in a <select> element.setChecked
Check or uncheck a checkbox or radio element.setInputFiles
Set the files for a file input element.tap
Tap the element (for touch devices).textContent
Get the textContent of the element.type
Focus the element and type text into it character by character.uncheck
Uncheck a checkbox element.waitForElementState
Wait for the element to reach a specific state.waitForSelector
Wait for a child element matching the selector.RemotePlaywrightFrame
Source:sdk/src/drivers/playwright/generated/frame.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
_isDetached | boolean | Whether this frame has been detached. |
Methods
$
Returns the ElementHandle pointing to the frame element.$$
Returns the ElementHandles pointing to the frame elements.$$eval
Finds all elements matching selector and passes them to pageFunction.$eval
Finds an element matching selector and passes it to pageFunction.addScriptTag
Adds a <script> tag into the page with the desired url or content.addStyleTag
Adds a <style> tag into the page with the desired url or content.check
Checks a checkbox or radio element.childFrames
Returns child frames of this frame.click
Clicks an element matching selector.content
Gets the full HTML contents of the frame, including the doctype.dblclick
Double-clicks an element matching selector.dispatchEvent
Dispatches an event on the element.dragAndDrop
Drags source element to target element.evaluate
Evaluates JavaScript in the frame context.evaluateHandle
Evaluates a function in the frame’s context and returns a handle to the result. Note: Returns serialized handle reference. Full JSHandle support not yet available.fill
Fills a form field with text.focus
Fetches the element matching selector and focuses it.frameElement
Returns the frame element associated with this frame.frameLocator
Returns a FrameLocator for the given selector.getAttribute
Returns element attribute value.getByAltText
Allows locating elements by their alt text.getByLabel
Allows locating input elements by the text of the associated label.getByPlaceholder
Allows locating input elements by the placeholder text.getByRole
Allows locating elements by their ARIA role, ARIA attributes and accessible name.getByTestId
Locate element by the test id.getByText
Allows locating elements that contain given text.getByTitle
Allows locating elements by their title attribute.goto
Returns the main resource response.hover
Hovers over an element matching selector.innerHTML
Returns the element.innerHTML.innerText
Returns the element.innerText.inputValue
Returns input.value for the selected <input> or <textarea> or <select> element.isChecked
Returns whether the element is checked.isDetached
Returnstrue if the frame has been detached, or false otherwise.
isDisabled
Returns whether the element is disabled.isEditable
Returns whether the element is editable.isEnabled
Returns whether the element is enabled.isHidden
Returns whether the element is hidden.isVisible
Returns whether the element is visible.locator
Creates a Locator for the given selector.name
Returns frame’s name attribute as specified in the tag.page
The page associated with this frame.parentFrame
Parent frame, if any. Detached frames and main frames return null.press
Presses a key.selectOption
Selects option(s) in the select element.setChecked
Checks or unchecks a checkbox or radio element.setContent
Sets the content of the frame.setInputFiles
Sets the file input element to the given files.tap
Taps an element matching selector.textContent
Returns the element.textContent.title
Returns the page title.type
Types into an element matching selector.uncheck
Unchecks a checkbox element.url
Returns frame’s URL.waitForFunction
Returns when the pageFunction returns a truthy value. Note: Returns serialized handle reference. Full JSHandle support not yet available.waitForLoadState
Waits for the required load state to be reached.waitForSelector
Returns when element specified by selector satisfies state option.waitForTimeout
Waits for the given timeout in milliseconds.waitForURL
Waits for the frame to navigate to the given URL.RemotePlaywrightJSHandle
Source:sdk/src/drivers/playwright/generated/js-handle.ts
Constructor
Methods
dispose
Releases the handle. After calling dispose, the handle is no longer valid.evaluate
Evaluates the given function with this handle as the first argument.evaluateHandle
Evaluates the given function with this handle as the first argument and returns a JSHandle.getProperties
Returns a map of property names to JSHandle instances for own properties of the object.getProperty
Returns a JSHandle for the property with the given name.jsonValue
Returns a JSON representation of the object.RemotePlaywrightKeyboard
Source:sdk/src/drivers/playwright/generated/keyboard.ts
Constructor
Methods
down
Dispatches a keydown event.insertText
Dispatches only an input event, does not emit keydown, keyup, or keypress events.press
Shortcut for keyboard.down() and keyboard.up().type
Sends a keydown, keypress/input, and keyup event for each character in the text.up
Dispatches a keyup event.RemotePlaywrightLocator
Source:sdk/src/drivers/playwright/generated/locator.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
selector | string | readonly |
Methods
all
Returns array of locators pointing to all matching elements.allInnerTexts
Returns an array of innerText values for all matching elements.allTextContents
Returns an array of textContent values for all matching elements.and
Creates a locator that matches both this locator AND the argument.blur
Removes focus from the element.boundingBox
Returns the bounding box of the element, or null if not visible.check
Checks a checkbox or radio button.clear
Clears the input field.click
Clicks on the element.clone
Clones the locator.contentFrame
Returns a FrameLocator pointing to the iframe this locator points to.count
Returns the number of elements matching this locator.dblclick
Double-clicks on the element.dispatchEvent
Programmatically dispatches a DOM event on the element.dragTo
Drags this element to the target element.elementHandle
Resolves to the ElementHandle of the element.elementHandles
Resolves to all ElementHandles matching this locator.evaluate
Evaluates a function in the browser context with the element as first argument.evaluateAll
Evaluates a function with all matching elements as first argument.evaluateHandle
Returns a JSHandle with the result of the evaluation.fill
Fills an input or textarea element with the specified value.filter
Narrows the locator with additional filters.first
Returns locator to the first matching element.focus
Focuses the element.frameLocator
Returns a FrameLocator for an iframe within this element.getAttribute
Returns the attribute value of the element.getByAltText
Locates elements by their alt attribute (typically images).getByLabel
Locates form elements by their associated label text.getByPlaceholder
Locates input elements by their placeholder text.getByRole
Locates elements by their ARIA role.getByTestId
Locates elements by their test ID attribute.getByText
Locates elements containing the specified text.getByTitle
Locates elements by their title attribute.highlight
Highlights the element on screen (for debugging).hover
Hovers over the element.innerHTML
Returns the innerHTML of the element.innerText
Returns the innerText of the element.inputValue
Returns the input value for <input>, <textarea>, or <select> elements.isChecked
Returns whether a checkbox or radio is checked.isDisabled
Returns whether the element is disabled.isEditable
Returns whether the element is editable.isEnabled
Returns whether the element is enabled.isHidden
Returns whether the element is hidden.isVisible
Returns whether the element is visible.last
Returns locator to the last matching element.locator
Creates a locator matching descendants of this element.nth
Returns locator to the nth matching element.or
Creates a locator that matches this locator OR the argument.page
Returns the Page that this locator belongs to.press
Presses a single key or key combination.pressSequentially
Types text character by character with keydown, keypress, and keyup events.screenshot
Takes a screenshot of the element.scrollIntoViewIfNeeded
Scrolls the element into view if not already visible.selectOption
Selects option(s) in a <select> element.selectText
Selects all text content of the element.setChecked
Sets the checked state of a checkbox or radio button.setInputFiles
Sets files for a file input element.setTimeout
Sets the timeout for this locator’s actions. Returns a new Locator with the updated timeout.tap
Performs a tap gesture on the element.textContent
Returns the textContent of the element.type
Types text into the element (DEPRECATED - use fill() or pressSequentially()).uncheck
Unchecks a checkbox.waitFor
Waits for element to satisfy the given state.RemotePlaywrightMouse
Source:sdk/src/drivers/playwright/generated/mouse.ts
Constructor
Methods
click
Shortcut for mouse.move(), mouse.down(), mouse.up().dblclick
Shortcut for mouse.move(), mouse.down(), mouse.up(), mouse.down(), mouse.up().down
Dispatches a mousedown event.move
Dispatches a mousemove event.up
Dispatches a mouseup event.wheel
Dispatches a wheel event.RemotePlaywrightPage
Source:sdk/src/drivers/playwright/generated/page.ts
Constructor
Properties
| Name | Type | Notes |
|---|---|---|
clock | RemotePlaywrightClock | readonly |
coverage | RemotePlaywrightCoverage | readonly |
id | string | getter • Get the page ID. |
keyboard | RemotePlaywrightKeyboard | readonly |
mouse | RemotePlaywrightMouse | readonly |
request | RemotePlaywrightAPIRequestContext | readonly |
touchscreen | RemotePlaywrightTouchscreen | readonly |
Methods
$
Query for a single element. Alias for page.querySelector().$$
Query for all matching elements. Alias for page.querySelectorAll().$$eval
Find all elements matching the selector and evaluate a function on the array of elements.$eval
Find an element matching the selector and evaluate a function on it.addInitScript
Add a script to evaluate before page scripts run.addLocatorHandler
Registers a handler that will be called when the specified locator becomes visible.addScriptTag
Add a <script> tag to the page.addStyleTag
Add a <style> tag to the page.bringToFront
Bring page to front (activate tab).check
Check a checkbox or radio button.click
Click on an element matching the selector.close
Close the page.consoleMessages
Returns all console messages captured during the page lifecycle.content
Get the full HTML content of the page.context
Get the browser context.dblclick
Double-click on an element matching the selector.dispatchEvent
Dispatch a DOM event on an element.dragAndDrop
Drag an element to another element.emulateMedia
Emulate media type, color scheme, etc.evaluate
Evaluate JavaScript in the page context.evaluateHandle
Evaluate JavaScript and return a handle to the result.exposeBinding
Expose a binding to the page (with source info).fill
Fill an input element with the given value.focus
Focus on an element.frame
Get a frame by name or URL.frameLocator
Create a frame locator.frames
Get all frames attached to the page.getAttribute
Get an attribute value from an element.getByAltText
Locate elements by alt text.getByLabel
Locate form controls by their associated label.getByPlaceholder
Locate input elements by placeholder text.getByRole
Locate elements by their ARIA role.getByTestId
Locate elements by data-testid attribute.getByText
Locate elements containing the given text.getByTitle
Locate elements by title attribute.goBack
Navigate back in history.goForward
Navigate forward in history.goto
Navigate to a URL.hover
Hover over an element.innerHTML
Get the inner HTML of an element.innerText
Get the inner text of an element.inputValue
Get the input value of an element.isChecked
Check if a checkbox is checked.isClosed
Check if the page is closed.isDisabled
Check if an element is disabled.isEditable
Check if an element is editable.isEnabled
Check if an element is enabled.isHidden
Check if an element is hidden.isVisible
Check if an element is visible.locator
Create a locator for the given selector.mainFrame
Get the main frame.markClosed
Mark this page as closed (internal use).opener
Get the page that opened this page (via window.open).pageErrors
Returns all page errors (uncaught exceptions) captured during the page lifecycle.pause
Pause script execution (for debugging).press
Focus an element and press a key combination.querySelector
Query for a single element.querySelectorAll
Query for all matching elements.reload
Reload the page.removeLocatorHandler
Removes a previously added locator handler.requestGC
Request garbage collection in the page context.requests
Returns all requests made by the page since the last navigation.route
Route requests matching the URL pattern.routeFromHAR
Serves network requests from a HAR (HTTP Archive) file.routeWebSocket
Route WebSocket connections matching the URL pattern.screenshot
Take a screenshot of the page.selectOption
Select one or more options in a <select> element.setChecked
Set the checked state of a checkbox.setContent
Set the HTML content of the page.setDefaultNavigationTimeout
Set the default navigation timeout.setDefaultTimeout
Set the default timeout.setExtraHTTPHeaders
Set extra HTTP headers for all requests.setInputFiles
Set input files for a file input element.setViewportSize
Set the viewport size.tap
Tap on an element (for touch devices).textContent
Get the text content of an element.title
Get the page title.type
Type text into an element (sends keydown, keypress/input, keyup events for each character).uncheck
Uncheck a checkbox.unroute
Remove a route.unrouteAll
Remove all routes.url
Get the current URL.video
Get the video object.viewportSize
Get the viewport size.waitForEvent
Wait for a specific event to fire.waitForFunction
Wait for a function to return a truthy value.waitForLoadState
Wait for the required load state to be reached.waitForNavigation
Wait for the main frame navigation and return the main resource response.waitForRequest
Wait for a specific request.waitForResponse
Wait for a specific response.waitForSelector
Wait for a selector to appear in the DOM.waitForTimeout
Wait for the specified timeout.waitForURL
Wait for the main frame to navigate to the given URL.workers
Get all web workers in the page.RemotePlaywrightTouchscreen
Source:sdk/src/drivers/playwright/generated/touchscreen.ts
Constructor
Methods
tap
Dispatches a touchstart and touchend event with a single touch at the position (x, y).RemotePlaywrightTracing
Source:sdk/src/drivers/playwright/generated/tracing.ts
Constructor
Methods
group
Creates a new trace group. All actions between group and groupEnd will be grouped together.groupEnd
Closes the last trace group opened by tracing.group().start
Start tracing to capture browser operations and network activity.startChunk
Start a new trace chunk.stop
Stop tracing and export it into a file.stopChunk
Stop the current trace chunk and export it.RemotePlaywrightWorker
Source:sdk/src/drivers/playwright/generated/worker.ts
Constructor
Methods
evaluate
Evaluates the given function in the worker context.evaluateHandle
Evaluates the given function in the worker context and returns a JSHandle.url
Returns the URL of the worker.Interfaces
PlaywrightBrowser
Source:sdk/src/drivers/playwright/types.ts
PlaywrightBrowserContext
Source:sdk/src/drivers/playwright/types.ts
PlaywrightKeyboard
Source:sdk/src/drivers/playwright/types.ts
PlaywrightLocator
Source:sdk/src/drivers/playwright/types.ts
PlaywrightLocatorFilterOptions
Source:sdk/src/drivers/playwright/types.ts
PlaywrightLocatorOptions
Source:sdk/src/drivers/playwright/types.ts
PlaywrightMouse
Source:sdk/src/drivers/playwright/types.ts
PlaywrightPage
Source:sdk/src/drivers/playwright/types.ts
External Re-exports
| Export | Kind | Source | Notes |
|---|---|---|---|
LocatorChainStep | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightBoundingBoxResult | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightCheckOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightClickOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightFillOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightFocusOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetAttributeOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByAltTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByLabelOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByPlaceholderOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByRoleOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGetByTitleOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGoBackOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGoForwardOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightGotoOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightHoverOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInnerHTMLOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInnerTextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightInputValueOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightIsOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightKeyboardOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightMouseClickOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightMouseMoveOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightNewContextOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightNewPageOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPageScreenshotOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPDFOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightPressOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightReloadOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightScreenshotOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightSelectOptionOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightTextContentOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightTypeOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForLoadStateOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForSelectorOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |
PlaywrightWaitForURLOptions | type | packages/schemas/src/drivers/playwright/options.ts | Re-exported from non-SDK source |

