• Stars
    star
    210
  • Rank 187,034 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross-platform WebPageTest agent

wptagent

Cross-platform WebPageTest agent

Contributing

There are separate lines of development under different licenses (pull requests accepted to either):

Supported Platforms/Browsers

  • Chromium-based browsers are the only ones that currently support manipulating requests (changing headers, blocking requests, etc). Firefox and Safari do not currently support capturing response bodies and running optimization checks.
  • All browsers should support basic page loading, scripts, and video capture on all platforms.
  • Traffic-shaping is supported on all platforms.

⚠️ Known Issues

  • Internet Explorer does not support manipulating requests (adding headers, blocking requests, etc)

Linux (with display, or headless with Xvfb)

  • Chrome: Stable, Beta, and Unstable
  • Firefox: Stable and Nightly
  • Opera: Stable, Beta, and Developer
  • Brave: Stable, Beta, Dev, and Nightly
  • Microsoft Edge: Dev
  • Epiphany: Ubuntu 20.04+
  • Vivaldi

Windows

  • Chrome: Stable, Beta, Dev and Canary
  • Firefox: Stable, ESR, Developer Edition, Beta, and Nightly
  • Microsoft Edge: Legacy and Chromium-based
  • Internet Explorer
  • Opera: Stable, Beta and Developer
  • Brave: Stable, Beta, Dev and Nightly

MacOS (Intel and Apple Silicon)

  • Chrome: Stable and Canary
  • Firefox: Stable and Nightly
  • Safari: iOS Simulator

Android (requires a tethered host; Raspberry Pi preferred)

  • Chrome (Stable, Beta, Dev, and Canary)
  • Samsung Internet
  • Several browsers run as “black box” tests (single page load, only visual metrics):
    • Chrome (Stable, Beta, Dev and Canary)
    • Samsung Browser
    • Opera
    • Opera Mini
    • UC Browser
    • UC Mini
    • Firefox (Stable and Beta)

Command-line options

Basic agent config

  • -v, -vv, -vvv…: Increase verbosity (specify multiple times for more). -vvvv for full debug output.

  • --name: Agent name (defaults to the machine’s hostname).

  • --exit: Exit after the specified number of minutes. Useful for running in a shell script that does maintenance or periodic updates (like hourly).

  • --dockerized: The agent is running inside a docker container.

  • --ec2: Load config settings from EC2 user data.

  • --gce: Load config settings from GCE user data.

  • --log: Log critical errors to the given file.

  • --noidle: Doesn't wait for system idle at any point.

  • --healthcheckport: HTTP Health check port (defaults to 8889). Set to 0 to disable. Returns 200 if the agent is running and communicating with the server, 503 otherwise.

  • --har : Generate a per-run HAR file as part of the test result (defaults to False).

Video capture/display settings (Linux only)

  • --xvfb: Use an Xvfb virtual display for headless testing.
  • --fps: Video capture frame rate (defaults to 10). Valid range is 1–60.

Server/location configuration

  • --server (required): URL for WebPageTest work. Example: https://www.webpagetest.org/work/.
  • --location (required): Location ID (as configured in the server’s locations.ini).
  • --validcertificate: Validate server certificates (HTTPS server, defaults to False).
  • --key : Location key (if configured in locations.ini).

Traffic-shaping (defaults to host-based)

  • --shaper: Override default traffic shaper. Supported values:
    • none: Disable traffic-shaping (i.e. when you can’t run as root).
    • netem,<interface>: Use NetEm to bridge reverse-tethered traffic (specify outbound interface). Example: --shaper netem,eth0
    • remote,<server>,<down pipe>,<up pipe>: Connect to the remote server over ssh and use preconfigured dummynet pipes. SSH keys for root user should be pre-authorized.
    • chrome: Use Chrome DevTools’s traffic-shaping. Only for Chromium-based browsers, and as a last resort because of inaccuracy.

Android testing

  • --android: Run tests on an attached Android device.
  • --device: Device ID, if more than one Android is attached.
  • --gnirehtet: Use the gnirehtet tool for reverse-tethering. You will need to manually approve the vpn once per mobile device. Valid options are:
    • <external interface>,<dns>: e.g. --gnirehtet eth0,8.8.8.8
  • --vpntether: (Android 7+) Use vpn-reverse-tether for reverse-tethering. You will need to manually approve the vpn once per mobile device. Valid options are:
    • <external interface>,<dns>: e.g. --vpntether eth0,8.8.8.8
  • --vpntether2 (recommended): Use vpn-reverse-tether v2 for reverse-tethering. You will need to manually approve the VPN once per mobile device. Valid options:
    • <external interface>,<dns>: e.g. --vpntether2 eth0,8.8.8.8
  • --simplert: Use SimpleRT for reverse-tethering. The APK should be installed manually (adb install simple-rt/simple-rt-1.1.apk) and tested once manually (./simple-rt -i eth0, then disconnect and re-connect phone) to dismiss any system dialogs. The ethernet interface and DNS server should be passed as options:
    • <interface>,<dns1>: i.e. --simplert eth0,8.8.8.8
  • --rndis (deprecated): Enable reverse-tethering over rndis (Android 6+). Valid options:
    • --rndis <ip>/<network>,<gateway>,<dns1>,<dns2>: Static Address. e.g. --rndis 192.168.0.8/24,192.168.0.1,8.8.8.8,8.8.4.4
    • --rndis dhcp

Authenticating the agent with the server

  • --username: Username if using HTTP Basic Auth with WebPageTest server.
  • --password: Password if using HTTP Basic Auth with WebPageTest server.
  • --cert: Client certificate if using certificates to authenticate the WebPageTest server connection.
  • --certkey: Client-side private key (if not embedded in the client certificate).

Running tests locally on the command-line

The test result is written as JSON to stdout. If a server, location, and key are provided, then the test will be uploaded to the given WebPageTest server and the test ID returned in the output JSON.

  • --testurl: Test the given URL via the command line (required unless --testspec is provided)
  • --testspec: Path to a full JSON file with test parameters
  • --browser: What browser to test in (can also be specified in the JSON file)
  • --testout: Output format fot the test result. Valid options:
    • id: Test ID (if tests are uploaded to a server/location)
    • url: URL to test result (if tests are uploaded to a server/location)
    • json: JSON-formatted raw test result
  • --testoutdir (optional): Output directory for the raw JSON test results
  • --testruns: Number of runs to test. Defaults to 1.
  • --testrv: Include repeat view (defaults to only testing first view)

Supported features

The following Script Commands are supported on Windows, Linux, Mac, and Android:

  • navigate
  • exec and execAndWait
  • block
  • sleep
  • logData
  • combineSteps
  • setEventName
  • setUserAgent
  • setBrowserSize, setViewportSize, and setDeviceScaleFactor
  • setActivityTimeout and setTimeout
  • blockDomains and blockDomainsExcept
  • setDns and `setDnsName
  • setHeader and addHeader (addHeader add multiple values for the same header, effectively the same as setHeader)
  • resetHeaders
  • setCookie
  • setABM
  • click, clickAndWait, and sendClick
  • selectValue and setValue
  • setInnerHTML and setInnerText
  • submitForm
  • overrideHost

Unsupported

There are no plans to implement the following Script Commands:

  • sendKeyDown
  • setDOMElement
  • waitForComplete
  • overrideHostUrl
  • ignoreErrors
  • logErrors (TODO: can’t find any mention of this in this GitHub organization?)
  • loadFile
  • loadVariables
  • minInterval
  • endInterval
  • expireCache
  • requiredRequest
  • setDOMRequest
  • waitForJSDone (change semantics to console.log message)
  • if, else, and endif

More Repositories

1

WebPageTest

Official repository for WebPageTest
PHP
3,047
star
2

WebPageTest.api-nodejs

WebPageTest API wrapper for NodeJS
JavaScript
1,644
star
3

workflow-telemetry-action

Github action to collect metrics (CPU, memory, I/O, etc ...) from your workflows to help you debug and optimize your CI/CD pipeline
TypeScript
264
star
4

WebPageTest.bulk-tester

Google App Script for spreadsheet that uses the WPT API to bulk test URLs
JavaScript
259
star
5

WebPageTest.RUM-SpeedIndex

Calculate SpeedIndex measurements from the field
JavaScript
200
star
6

WebPageTest.github-action

Automatically test code changes in WebPageTest and enforce performance budgets
JavaScript
198
star
7

WebPageTest.docs

Documentation for WebPageTest
JavaScript
192
star
8

WebPageTest.visual-metrics

Calculate visual performance metrics from a video (Speed Index, Visual Complete, Incremental progress, etc)
Python
154
star
9

WebPageTest.win-shaper

Windows traffic-shaping packet filter
C++
126
star
10

WebPageTest.xrecord

Console app for capturing video on OS X (particularly from iOS devices)
Swift
122
star
11

WebPageTest.beacon-ml

Evaluate web beacon metrics for impact on business metrics
Python
75
star
12

WebPageTest.tsproxy

Traffic-shaping SOCKS5 proxy
Python
73
star
13

Pietrasanta-traceroute

C
39
star
14

Tracing.examples-kubernetes-java

Catchpoint Tracing examples for Java applications deploying to Kubernetes
Java
23
star
15

WebPageTest.slack

WebPageTest and Slack Integration
JavaScript
21
star
16

WebPageTest.api-recipes

A collection of useful recipes for the WebPageTest API
JavaScript
13
star
17

WebPageTest.agent-install

Automated scripts for installing dedicated wptagent instances
Shell
10
star
18

WebPageTest.iTether

Reverse-tether app for iOS
Python
9
star
19

WebPageTest.iWptBrowser

wkWebView browser shell for iOS WebPagetest agent (integrates with wptagent)
Swift
9
star
20

WebPageTest.server-install

Installation scripts for the WebPageTest server
Shell
9
star
21

WebPageTest.vscode-extension

JavaScript
7
star
22

foresight-test-kit-action

Action for optimizing your tests by listing test runs and with history
TypeScript
7
star
23

WebPageTest.recorder-chrome-extension

A Chrome extension for outputting user recording sessions as WebPageTest Custom Scripts
JavaScript
6
star
24

WebPageTest.pcap-parser

Parser to extract information from tcpdump pcap files for WebPageTest
Python
6
star
25

WebPageTest.recorder-to-script

Script to convert Chrome user flow recordings to WPT Custom Scripts
TypeScript
6
star
26

WebPageTest.trace-parser

Parser to extract information from Chrome Traces for WebPageTest
Python
6
star
27

foresight-issues

This is the place where the Foresight issues are put in the table
5
star
28

Integrations.SIP

Shell
5
star
29

foresight-workflow-kit-action

TypeScript
5
star
30

WebPageTest.extension-chrome

Chrome helper extension to launch WebPageTest for current URL
JavaScript
5
star
31

WebPageTest.adbwatch

Python app that monitors and kills the Android Debug Bridge when it stops working.
C++
4
star
32

WebPageTest.devtools-parser

Parse a remote dev tools event log and produce page-level and request information json files
Python
3
star
33

WebPageTest.healthcheck

HTTP Healthcheck responder for WebPageTest agents (wptagent)
Python
3
star
34

WebPageTest.etw

Windows ETW watcher for wptagent
C#
3
star
35

WebPageTest.browser-install

Automatically install and keep browsers up to date with the latest releases (on Windows)
Python
2
star
36

Community-Scripts

Repository for custom scripts.
Python
2
star
37

WebPageTest.chromehooks

Windows command-line utility to find the function offsets for SSL/TLS functions in Chrome using the public symbols
Python
2
star
38

WebPageTest.microsoft-teams-bot

JavaScript
2
star
39

Integrations.GoogleCloudMonitoring

JavaScript
2
star
40

WebPageTest.extension-firefox

Extension for Firefox to launch WebPageTest for current URL
JavaScript
2
star
41

Integrations.splunk

Python
1
star
42

Integrations.SumoLogic

1
star
43

WebPageTest.crawler

JavaScript
1
star
44

WebPageTest.battery-time

Browser-based battery life test suite. Used for measuring how long a device can run on a single charge.
1
star
45

terraform-provider-catchpoint

Go
1
star
46

foresight-client-sdk

Foresight API client SDK
Java
1
star
47

Integrations.NewRelic

New Relic Integrations uses catchpoint Test Data Webhook to send data to New Relic Platform, this is accomplished by using New Relic’s Metrics API. To complete this integration, we will rely on third party cloud function to accept the data from Catchpoint API, process it in the desired format and then push it to New Relic. With this integration we are enabling DevOps team to visualise Catchpoints digital experience data with New Relic’s Application Performance Monitoring (APM) data together.
JavaScript
1
star
48

WebPageTest.winres

Set the Windows desktop to the maximum supported by the monitor/video card. This is primarily used in a headless environment like EC2 to maximize the desktop for visual testing.
C++
1
star
49

WebPageTest.tcpdump

Windows tcpdump console app for wptagent (requires WinPCap)
C
1
star
50

Tracing.examples-kubernetes-go

Catchpoint Tracing examples for Go applications deploying to Kubernetes
Go
1
star
51

webpage-visually-complete

Visually Complete is calculated by reporting the time until roughly 80% of elements in the viewport have loaded. It references img, iframe, css, script, and subdocument elements in the Resource Timing API to determine the time from navigation to the page appearing loaded to an end user.
1
star