Input
bonk provides methods for simulating user input — clicks, typing, key presses, file uploads, and form interactions.
Click
All mouse methods scroll the element into view and wait for visibility first. Clicks target the center of the element's bounding box.
Text Input
Fill
Clears the field and inserts text instantly:
Type
Types character by character with key events:
Each character dispatches keyDown and keyUp events.
Key Press
Send a single key:
Focus
Form Controls
Select
Dispatches input and change events.
Checkbox / Radio
File Upload
Page Shorthand
Page-level methods combine WaitSelector with element interaction:
page.Click("#submit")
page.Fill("#email", "test@test.com")
page.Type("#search", "query", bonk.WithDelay(50*time.Millisecond))
page.Press("#input", "Enter")
Click, Fill, and Press accept WaitOption for configuring the selector wait:
Type accepts TypeOption, including WaitFor for selector wait options: