Methods
page.click()
Clicks an element matching the CSS selector.
selector: CSS selector for the element to clickoptions(optional): Click options
Promise<boolean> - true if click succeeded
Examples:
page.input()
Types text into an input element.
selector: CSS selector for the input elementtext: Text to typeoptions(optional): Input options
Promise<void>
Examples:
page.select()
Selects an option in a <select> element.
selector: CSS selector for the select elementvalue: Value of the option to select
Promise<void>
Example:
Complete examples
Form submission
Contact form submission
Search and filter
Multi-step form
Framework-aware interaction
Handling dynamic content
Best practices
Wait before interacting
Wait before interacting
Always wait for elements to appear before interacting:
Use specific selectors
Use specific selectors
Use unique, stable selectors (IDs are best):
Check click results
Check click results
Verify that clicks succeeded:
Simulate realistic typing
Simulate realistic typing
Use realistic typing for forms that may have frontend validation:
Related
Waiting
Wait for elements before interacting
JavaScript
Execute custom interactions
Events
Monitor interaction events
Page overview
Back to Page API overview