Search code examples
speed-test

ERROR: UrlLoadError: Failed to load/verify on speedtest.io when trying to test something on localhost


When I try to run tests on my localhost using speedtest.io I get the following output:

Google Chrome 71.0.3578.80
Mozilla Firefox 64.0
[2019-02-02 19:50:35] INFO: Versions OS: linux 4.9.125-linuxkit nodejs: v10.13.0 sitespeed.io: 7.7.3 browsertime: 3.11.1 coach: 2.4.0
[2019-02-02 19:50:35] INFO: Starting chrome for analysing http://localhost:5000/issues/44 8 time(s)
[2019-02-02 19:50:35] INFO: Testing url http://localhost:5000/issues/44 iteration 1
[2019-02-02 19:50:39] ERROR: UrlLoadError: Failed to load/verify http://localhost:5000/issues/44 uri:chrome-error://chromewebdata/
    at SeleniumRunner.loadAndWait (/usr/src/app/node_modules/browsertime/lib/core/seleniumRunner.js:200:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I ran speedtest with the following command: docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:7.7.3 --config config.json http://localhost:5000/issues/44

My config.json file has the following configs:

{
  "browsertime": {
    "iterations": 8,
    "browser": "chrome"
  },
  "utc": true,
  "outputFolder": "edited_chrome"
}

If I try to test a website like github.com or anything else in the web, this configuration works fine.


Solution

  • I was using the wrong command. I was running the website on my computer and sitespeed on docker, so docker couldn't see my localhost Fortunately there is an easy solution for this if you're on a Mac, simply use something like:

    docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:8.2.3 -b firefox http://host.docker.internal:4000/