Create HAR and performance data headlessly with Chrome and Firefox using Browsermob-Proxy
This tool helps you to capture HTTP Archive (HAR) and additional performance data using Navigation Timing API from either Chrome or Firefox headlessly.
-
Install xvfb
sudo apt-get install -y xvfb
-
Download Browsermob-proxy
-
Download selenium-server
wget http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
-
Start selenium-server
java /usr/bin/java -jar selenium-server.jar >> ./log/selenium.$(date +"%Y%d%m").log 2>&1&
-
Download chrome driver
wget -N http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver -
Install Python Dependencies for browsermob-proxy, selenium and xvfb
sudo apt-get install python-pip
sudo pip install selenium browsermob-proxy xvfbwrapper --upgrade
python speedprofile.py --url [url to test] --browser [chrome/fireox] --path [path to save output files]
-
Install Docker -- https://www.docker.com/
-
Run the build-chrome script to create a docker image tagged
speedprofile-chrome
./docker/build-chrome.sh
# To test your local image, run:
docker run -v $(pwd)/output:/output speedprofile-chrome <url>
# Performance/HAR files will be generated in the local "output" folder.
- Quickstart: If you want to skip the build (2), you can simply run the public docker image with the included wrapper script:
./docker/run-chrome.sh <url>