joes-totwFor the last few months I’ve been negligent on my regular blogging.  I can come up with a bunch of excuses but it all boils down to feeling that I’ve got something meaningful to say.  I’m not the type to just blog for the sake of blogging but I’ve begun to miss the great feedback I receive when I put something out there that helps folks. 

What has worked for me in the past is to come up with the concept of an ABC’s series where I put sequential posts out with each post having a topic based on the letters in the alphabet.  I started with The Networking ABC’s, followed that up with Social Media ABC’s and most recently finished up the PowerShell ABC’s.  I’ve been trying to figure out a new series that could be interesting to folks and I think I’ve found my next one.

I tend to tinker around with lots of tools and utilities with regards to development and website and server maintenance.  Most recently I’ve been working on some performance testing and tuning for our website when I came across the automation features of HttpWatch.  I thought to myself: A is for Automating!  That’ll be a start of a fun series.

So here we are, the first post in a set of 26 and since these will be around tools and tips, I’ve decided to name this series the Tips Of The Week ABC’s.  I’m not sure I can push out one per day like I’ve done in the past, so I’m going to shoot for a more manageable one per week.  I hope you all find this useful.

A is for Automating HTTPWatch

HttpWatch

HttpWatch is an integrated HTTP sniffer for Internet Explorer and FireFox hat provides new insights into how your website loads and performs.  HttpWatch can be used for a wide variety of tasks including:

  • Testing a web application to ensure that it is correctly issuing or setting headers that control page expiration
  • Finding out how other sites work and how they implement certain features
  • Checking the information that the browser is supplying when you visit a site
  • Verifying that a secure web site is not issuing sensitive data in cookies or headers
  • Tuning the performance of a web site by measuring download times, caching or the number of network round trips
  • Learning about how HTTP works (useful for programming and web design classes)
  • Alowing webmasters to fine tune the caching of images and other content
  • Performing regression testing on production servers to verify performance and correct behavior

What some don’t know is that HttpWatch includes an automation interface to allow for a user to build automation scripts around HttpWatch’s functionality.  There are a set of Windows COM Objects that you can program to with your tools of choice.  The included documentation for HttpWatch includes examples of using their COM interfaces with C#, JavaScript, Ruby, and VBScript.  In this post, I’ll cover using using PowerShell to do the autmation.

HttpWatch.Controller

The core object is the HttpWatch.Controller.  It contains the following members

  • FireFox –Returns a reference to the FireFox object.  Use this property if you want to be using FireFox in your testing.
  • IE – Returns a reference to the Internet Explorere object.  Use this property if you want to use IE for your testing.
  • IsBasicEdition – Returns true if the product is the basic edition, false for Pro.
  • OpenLog(logFileName) – This allows existing HttpWatch log files to be opened and examined using the automation library.
  • Wait(plugIn, timeOutSecs) – Wait for a page to be fully loaded and is normally used after the GotoURL method.
  • Version – A string containing the current version of HttpWatch.

Creating this object in PowerShell is as easy as calling the New-Object cmdlet.