Automates page load testing with Firefox + Selenium IDE + har-export-trigger. Exports to HAR to view page timings and resource loading times. Originally used to test websites against a mid-latency network.
Raw sampled HAR data also provided.
Note: It does not use page ready method as it is unreliable (especially for JavaScript rendered websites) because it sometimes does not wait for DOM completion
pip install haralyzer
Optional (for graph.py script, can be omitted):
pip install matplotlib (may require sudo apt-get install python-tk)
pip install numpy
Linux and Firefox 54 (should work with 42+)
Load temporary add-on: harexporttrigger-0.5.0-beta.10.xpi (currently no signed version by developer)
use these settings:
extensions.netmonitor.har.contentAPIToken = "test"
extensions.netmonitor.har.enableAutomation = "true"
settings > tick "disable HTTP Cache"
Download and install https://addons.mozilla.org/en-GB/firefox/addon/selenium-ide/
- Open Firefox with the above settings
- Open Firefox Developer Tools and then visit a website for testing. Genereated HAR files are located at (usually)
~/.mozilla/firefox/[user]/har/logs
- To automate using Selenium script:
- Go to about:addons and Selenium IDE "Preferences"
- Under "Selenium Core Extensions", select user-extension.js as provided (make sure while.js is in the same directory)
- Go to
Firefox > Tools > Selenium IDE
- Right click "Add Test Case" and select the selenium file as provided
- Run test case
- Put graph.py script inside ~/.mozilla/firefox/[user]/har/logs folder and run
./graph.py
https://github.com/firebug/har-export-trigger
https://addons.mozilla.org/en-GB/firefox/addon/selenium-ide/
http://www.software-testing-tutorials-automation.com/2013/07/example-of-while-and-endwhile-loop.html