PhantomJS – headless webpage testing

PhantomJS ( is a headless WebKit scriptable with JavaScript or CoffeeScript.

PhantomJS is the closest to real browser.

PhantomJS can be used to generate HAR from URL by commandline without requirement of a browser.

Reference Links :

  1. Google Code Page describing the usecases
  2. Quick Start tutorial page :
  3. Build Instructions from Source :
  4. ReadyMade binary files for different OS :
  5. Binary I have tested on RHEL-6 :
  6. Nagios using PhantomJS page loadtime : 

Example Commandline for generating HAR file from URL

  • bin/phantomjs examples/netsniff.js > movies.har

Example Commandline for generating PageLoad time from URL

  • bin/phantomjs examples/loadspeed.js
    • Page title is Yahoo! Movies - Upcoming Movies, Trailers and Showtimes
      Loading time 3143 msec

Cons : Flash might not work(!)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: