Documentation / Scripting
Scripting
Scripting in sitespeed.io and Browsertime lets you measure user journeys by interacting with web pages — login flows, multi-step transactions, anything a user can do. Scripting works the same in both Browsertime and sitespeed.io.
If you're new to scripting, start with the Introduction and work through the tutorials in order. The API reference is for looking up specific commands once you know what you want.
Tutorials
- Introduction
- Running and managing scripts
- Pre and post scripts
- Measure
- Custom metrics
- Visual elements and element timing
- Interact with the page
- Waiting recipes
- Interact with the browser
- Iframes and popups
- Cookies and consent banners
- User journeys
- Error handling
- Debugging scripts
- Code completion and IntelliSense
- Examples
- Running Selenium code
- Chrome Devtools Protocol (CDP)
- CDP recipes
- Using Bidi
- Mobile devices
- Tips and tricks
API reference
The class reference is auto-generated from the Browsertime source code. Start at Commands — it's the entry point everything else hangs off.
Common ones:
- Measure — start and stop measurement
- Click, SingleClick, DoubleClick, ClickAndHold
- Wait, Navigation, Switch
- Element, JavaScript, Cookie
- Bidi, ChromeDevelopmentToolsProtocol, AndroidCommand