As a functional automation tester have you ever been asked the following questions:
- From Infrastructure - We have upgraded the network and are expecting an increase in throughput. Can you please run a quick test and let us know the improvement stats?
- From a Developer – We have made some changes to the framework and are expecting some issues. Can you please run some tests and let us know the error codes?
I was faced with the second question, and after a bit of googling and discussions with the Dev team I found out about HttpWatch: http://www.httpwatch.com/
A quick read of their website gave me this:
If you want to investigate more about the features that HttpWatch provides, go here: http://www.httpwatch.com/features.htm
Using HttpWatch with WatiN: http://blog.httpwatch.com/2008/10/30/using-httpwatch-with-watin/
The steps to integrate HttpWatch into Axe are as follows, or you can just download the sample Axe project, install HttpWatch and get testing:
1.Axe and WatiN installed and configured.
2.A WatiN project with a local Action Map and custom library file.
3.Download and install the free Basic Edition of HttpWatch.
4.Add two methods to the custom project library file.
5.Modify the local Action Map and Run config files.
The output from HttpWatch is a hwl.file per Axe test, so if you have 100 Axe tests, you will get a 100 hwl.files. Not a good thing, when you are pressed for time. To minimise the time spent pouring over the output files you should create a test run that exercises most pages, and add a switch to the Run config file to turn the HttpWatch logging on or off.
I downloaded the free Basic Edition of HttpWatch (http://www.httpwatch.com/download/), version 6.2.10 and installed it using the default options. A HttpWatch folder was created in my ProgramFiles folder on the C drive.
Adding Methods to the Project Library File
If you do not have a custom project library file, see the Axe documentation for creating one.
The first step is to add a reference to HttpWatch to your custom library project.
We are going to add two methods to the Project Library file called:
- InitialiseHttpWatch(), and
if (String.Compare(axe.GetRunCategoryOption("Option", "HttpWatch"), "TRUE", true) == 0)
// Attach HttpWatch to instance of IE
HttpWatch.Controller ct = new HttpWatch.Controller();
HttpWatch.Plugin plugin = ct.IE.Attach((SHDocVw.IWebBrowser2)ie.IE.InternetExplorer);
// Start recording a log file in HttpWatch
public static void CloseHttpWatch(HttpWatch.Plugin plugin, string resultDir, string testID)
if (plugin != null)
plugin.Log.Save(resultDir + @"\" + testID + ".hwl");
HttpWatch.Summary logSummary = plugin.Log.Entries.Summary;
There are two variables in the CloseHttpWatch() method , testID and resultDir that need to be declared and set. This is done in the __testPrefix section of the Local Action Map.
Modify the Run Config File
Add the following switch to the Run config file and set it to False:
This is where you turn on the HttpWatch logging. The code looks for a value of TRUE to start logging, any other value and the logging will be turned off.
Modify the Local Action Map
Add the following to the __testPrefix section of the Local Action Map:
// Run settings
string testID = "%TESTID%";
string resultDir = @"%RESULTDIR%";
HttpWatch.Plugin plugin = null;
Modify the testEnd(id) section of the Local Action Map to look like the following:
NovaTest.NovaTestLib.CloseHttpWatch(plugin, resultDir, testID);
if(ie.IE != null) ie.IE.Dispose();
You should now be able to Build and Run your Axe project and view the HttpWatch output in the Results directory.
Integrating HttpWatch into Axe does not make Axe a performance test tool, but it does give you some extra ammo in the hunt for bugs.
Senior Test Automation Analyst
Users must extract the zip file to c:\nfocushttpwatch because some paths are hardcoded for expediency.
Versions of software for reference:
Axe : 2.0.3
Watin : 1.3 (.NET 2.0)
HttpWatch Basic : 6.2.10