Documentation / Details

Details

A simple example

Use our Docker image (Chrome, Firefox, Xvfb and the dependencies needed to record a video are all included):

docker run --rm -v "$(pwd)":/browsertime sitespeedio/browsertime:27.2.0 --video --visualMetrics https://www.sitespeed.io/

Or with Node.js:

browsertime https://www.sitespeed.io

This loads https://www.sitespeed.io/ once in Chrome and writes the JSON file with the timing data (browsertime.json) and the HAR file (browsertime.har) to browsertime-results/www.sitespeed.io/$date/. Use -n 3 to run the URL three times.

Speed Index and video

The easiest way to get a video and Speed Index is to use our Docker container — it ships with the dependencies needed to run VisualMetrics.

The default video has a timer overlay and markers showing when the metrics fire. You can turn that off with --videoRaw.

Test using Docker

You can build and test changes locally with Docker. First build it:

docker build -t sitespeedio/browsertime .

Then run it:

docker run --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime -n 1 --video --visualMetrics https://www.sitespeed.io/

Connectivity

You can throttle the network to slow the connection down — that makes regressions easier to spot. The recommended way is to set up a Docker network bridge or use Throttle. Read the full guide here.

Test on your mobile device

Browsertime supports Chrome on Android (Visual Metrics, HAR and video) and Safari on iOS (HAR via ios_webkit_debug_proxy, plus video and Visual Metrics over USB on macOS).

Before you start:

Mobile testing is not supported in Docker, so install the VisualMetrics dependencies on your machine first.

If you want to throttle the connection on a real device, use something like Pi Network Conditioner.

browsertime --android https://www.sitespeed.io --video --visualMetrics