Skip to main content
The Page interaction API provides methods for clicking elements, typing input, and interacting with forms.

Methods

page.click()

Clicks an element matching the CSS selector.
Parameters:
  • selector: CSS selector for the element to click
  • options (optional): Click options
Options:
Returns: Promise<boolean> - true if click succeeded Examples:
Use simulateFramework: true when clicking elements in React, Vue, or Angular applications that rely on framework-specific event handlers.

page.input()

Types text into an input element.
Parameters:
  • selector: CSS selector for the input element
  • text: Text to type
  • options (optional): Input options
Options:
Returns: Promise<void> Examples:

page.select()

Selects an option in a <select> element.
Parameters:
  • selector: CSS selector for the select element
  • value: Value of the option to select
Returns: Promise<void> Example:

Complete examples

Form submission

Contact form submission

Search and filter

Multi-step form

Framework-aware interaction

Handling dynamic content

Best practices

Always wait for elements to appear before interacting:
Use unique, stable selectors (IDs are best):
Verify that clicks succeeded:
Use realistic typing for forms that may have frontend validation:

Waiting

Wait for elements before interacting

JavaScript

Execute custom interactions

Events

Monitor interaction events

Page overview

Back to Page API overview