Methods & Tools Software Development Magazine

Software Development Magazine - Project Management, Programming, Software Testing

Scrum Expert - Articles, tools, videos, news and other resources on Agile, Scrum and Kanban

WebPageTest - Online Website Performance and Analytics Tool

WebPageTest is an open source web performance tool providing diagnostic information about how a web page performs under a variety of conditions. It offers an online version where each test can be run from different locations around the world, on real browsers, over any number of customized network conditions.

WebPageTest.org was acquired in September of 2020 by Catchpoint. It pledged to keep the usage of this online tool free and planned to expand its capabilities and geographical performance testing footprint, leveraging Catchpoint’s infrastructure, adding capacity and improving consistency and quality of analytics. It has also introduced some additional paid features like the WebPageTest REST API that gives you external access to WebPageTest's analysis, letting you pull performance data into your existing workflows and processes.

Website:  https://www.webpagetest.org/ and https://github.com/WPO-Foundation/webpagetest
Version tested: online version in November 2021
System requirements: You can install the open source WebPageTest tool on any OS that supports PHP.
License: There are two separate tracks of development under different licenses and pull requests are accepted to either of them. The master branch where most active development is occurring is under the Polyform Shield 1.0.0 license and there is an "apache" branch which is under the more permissive Apache 2.0 license.
Support: https://forums.webpagetest.org/
Documentation: https://docs.webpagetest.org/

Documentation

The documentation available on WebPageTest.org is rather complete and easy to navigate. It provides valuable information on how to run tests and interpret the results.

Installation

The WebPageTest code can be installed on private instances. WebPageTest can be configured to run all on one system (with the web server and test machines all running on the same PC) or with separate systems for the web server and testers. The Web Server can be any OS that supports PHP (Linux and Windows have both been tested). Ubuntu 18.04 is recommended.

Using WebPageTest

User account

You can create a user account on webpagetest.org. This account allows accessing and comparing your past test results. Currently WebPageTest stores up to 30 days of test history from the local browser that is made available as long as storage isn't cleared. Creating an account helps keep your test history for longer and to see test history across multiple browsers. In your test history, you can also compare the results of multiple test runs. It will also allow participating to forum and using the WebPageTest API.

WebPageTest - Online Website Performance and Analytics Tool
(click on figure to enlarge it)

Running tests

WebPageTest provides different options to run tests on a web page.

  • Advanced Testing: This is the default option. Besides the location and the browser/mobile phone, you can choose different setups for your test like connection type (cable, xG, etc.), number of tests, chromium options, scripting or custom metrics.

  • Simple Testing: This window provides a limited browser/devices/location configuration options 

  • Web Vitals: This test focuses only on core statistics that influences the SEO ranking of a web page: Largest Contentful Paint (LCP), Content Layout Shift (CLS), First Input Delay (FID), Total Blocking Time (TBT). These statistics are included also in the global report.

  • Visual Comparison. With this option you can compare visually the results of testing different web pages.

  • Traceroute. This option shows the route with timing in milliseconds between the chosen datacenter and a website/IP address.

Once you click on the “Stat Test” button, your test is put in the queue, waiting to be processed.

Analyzing results

WebPageTest results contains various indicators, information and statistics from the tested webpage that you can examine at the global or detailed point of view.

WebPageTest - Online Website Performance and Analytics Tool
(click on figure to enlarge it)

At the top of the results page are a set of grades for the most critical performance optimizations areas. These cover the basic optimizations that apply to just about all sites and will put in evidence areas where you should investigate and improve.

The documentation contains valuable information about the different metrics groups and the individual metrics that are available on the test report. These metrics will provide you information about the loading speed, number of requests and size of your web page. 

WebPageTest - Online Website Performance and Analytics Tool
(click on figure to enlarge it)

When you run multiple tests and you store them in your account, you can get a visual comparison of the page content between both test, a feature that could be helpful for regression testing.

WebPageTest - Online Website Performance and Analytics Tool
(click on figure to enlarge it)

Advanced features

Lighthouse reportLighthouse is an open-source tool developed by Google for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, SEO and more. WebPageTest can run a Lighthouse test on a given web page, either interdependently or as an additional test alongside the normal test report.

Scripting: WebPageTest has its own scripting language that lets you automate a multi-step test that will for instance fill an online order and process to checkout. The language is described in the documentation with examples scripts.

Custom metrics: WebPagetest can execute arbitrary JavaScript at the end of a test to collect custom metrics. These can be defined statically in the server configuration or be specified at runtime on a per-test basis. The JavaScript should be written as if it were executing inside of a function call and return the custom metric at the end. You can use this option to detect blocking external scripts or images without the alt attribute. Example scripts are provided.

Conclusion

WebPageTest.org provides a powerful free tool to test and analyze the performance of your website. It offers both a simple configuration for quick testing of a web page and advanced options for more complex testing scenarios and custom metrics gathering.

One of the disadvantages of using the online version is that you test is put in a queue and you could have to wait sometimes some hours so that 1000s of waiting tests are executed before your test can run. If you work on a live website, it forces you to plan your tests carefully as you cannot quickly test variations of the same pages to see the impact of modifications.


Click here to view the complete list of tools reviews

This article was originally published in November 2021

Methods & Tools
is supported by


Testmatick.com

Software Testing
Magazine


The Scrum Expert