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

  1. Introduction
  2. Running and managing scripts
  3. Pre and post scripts
  4. Measure
  5. Custom metrics
  6. Visual elements and element timing
  7. Interact with the page
  8. Waiting recipes
  9. Interact with the browser
  10. Iframes and popups
  11. Cookies and consent banners
  12. User journeys
  13. Error handling
  14. Debugging scripts
  15. Code completion and IntelliSense
  16. Examples
  17. Running Selenium code
  18. Chrome Devtools Protocol (CDP)
  19. CDP recipes
  20. Using Bidi
  21. Mobile devices
  22. 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: