My favorites | Sign in
Logo
       
People details
Project owners:
  cgoldberg

Automated Web/HTTP Profiler with Selenium-RC and Python

by Corey Goldberg (c) 2009


What is it?

Selenium-profiler is a web/http profiler built with Selenium-RC and Python. It profiles page load time and network traffic for a web page. The profiler uses Selenium-RC to automate site navigation (via browser), proxy traffic, and sniff the proxy for network traffic stats as requests pass through during a page load.

It is useful to answer questions like:


License:

GNU GPL v3
This program is Free Open Source software


Contents:


How do you use it?

  1. Install Python (and add it to your path)
  2. Install Java (and add it to your path)
  3. Get selenium-profiler code from Subversion
  4. Unzip Selenium RC and search for 'selenium-server.jar' and 'selenium.py'
  5. Copy them to a directory and run 'java -jar selenium-server.jar' to start the server
  6. Open web_profiler.py and set your parameters
  7. Run web_profiler.py

*notes:
you may need to adjust browser security settings to get it to work properly
to run against an HTTPS/SSL enabled site, you need to install a fake certificate. look inside selenium-server.jar for the cert.


Command Line Parameters:

web_profiler.py takes 2 command line arguments:

web_profiler.py <url> [browser_launcher]

Sample usage:

> python web_profiler.py www.google.com *firefox

(use *firefox to launch Mozilla Firefox)
(use *iexplore or *iexploreproxy to launch Internet Explorer)
(use *googlechrome to launch Google Chrome)


Browsers/Platforms:

This profiler seems to run best under MS Windows with either Firefox or IE. I have tested under various combinations with mixed success:

Working:

Partially Working:


Sample Output:

--------------------------------
results for http://www.google.com/

content size: 31.096 kb

http requests: 7
status 200: 6
status 204: 1

profiler timing:
0.344 secs (page load)
0.328 secs (network: end last request)
0.110 secs (network: end first request)

file extensions: (count, size)
gif: 1, 3.011 kb
ico: 1, 1.150 kb
js: 2, 18.083 kb
png: 1, 5.401 kb
unknown: 2, 3.451 kb

http timing detail: (status, method, doc, size, time)
204, GET, /generate_204, 0, 62 ms
200, GET, /favicon.ico, 1150, 31 ms
200, GET, /barcode09.gif, 3011, 31 ms
200, GET, /, 3451, 110 ms
200, GET, /2cca7b2e99206b9c.js, 3451, 78 ms
200, GET, /nav_logo7.png, 5401, 16 ms
200, GET, /f_wkquEsVv8.js, 14632, 47 ms
--------------------------------










Hosted by Google Code