Download and Buy Now Link

Using HttpWatch and WatiN 2.1

 June 25, 2012

In a previous post we described how to interact with a web page using WatiN 1.3 while recording HTTP/HTTPS traffic in HttpWatch. It was a popular post, used by many customers to build automated web page tests that used HttpWatch to provide performance metrics, check for HTTP level errors and to look for opportunities to improve performance.

Since then, WatiN 2.1 has been released providing significant improvements and the ability to interact with Firefox 3.6 as well as Internet Explorer. Unfortunately, a change in the WatiN assembly caused a type conflict with HttpWatch over the definition of IE’s IWebBrowser2 type. This could give rise to the compilation errors in a Visual Studio C# project:

error CS1758: Cannot embed interop type ‘SHDocVw.CommandStateChangeConstants’ found in both assembly ..\WatiN\bin\net20\Interop.SHDocVw.dll’ and ‘…\obj\Debug\Interop.SHDocVw.dll’. Consider setting the ‘Embed Interop Types’ property to false.

If you had marked the project to build against .Net 2.0 there isn’t even an option to set ‘Embed Interop Types’ to false.

The way to avoid this error is to delete the ‘Interop.SHDocVW’ reference that you may have added from the WatiN bin directory:

In HttpWatch 8.3.19 we’ve added a WatIN sample program and documentation to provide a starting point for using WatiN 2.1.

The sample program shows you how to fill out a simple web form:

and retrieve values from the resulting page:

There are two ways to get HttpWatch and WatiN to work on the same instance of IE. The first is to create the new instance with WatiN and then attach HttpWatch:

// Attach HttpWatch to an instance of IE created through WatiN
WatiN.Core.IE watinBrowser = new WatiN.Core.IE();
HttpWatch.Plugin plugin = control.IE.Attach((SHDocVw.IWebBrowser2)watinBrowser.InternetExplorer);

Or you can create the instance in HttpWatch and attach WatiN:

// Attach WatiN to an instance of IE created through HttpWatch
HttpWatch.Plugin plugin = control.IE.New();
WatiN.Core.IE watinBrowser = new WatiN.Core.IE(plugin.Container);

For more information about using WatiN with HttpWatch please take a look at the sample program that is installed with HttpWatch Basic and Professional Editions:

http://apihelp.httpwatch.com/#WatiN Form Fill Sample.html

 

 

 

 

 

Posted on June 25, 2012 in Automation,C#,HttpWatch,Internet Explorer Tags: ,

Comments are off for this post |Post a Comment RSS for this post |Trackback URL

Firefox 11, IE 10 and New Auto-Completion Feature in HttpWatch 8.1

 March 14, 2012

HttpWatch 8.1 is now available for download. The new features in this release include support for Firefox 11:

and Internet Explorer 10 running on the Windows 8 Customer Preview:

There’s also support for auto-completion of text entered into the Find:

and Filter windows:

You can check whether you have the latest version installed by going to Help->Check for Updates in HttpWatch. A full list of changes is available in the version history.

Posted on March 14, 2012 in Firefox,HttpWatch,Internet Explorer Tags: ,,

Comments are off for this post |Post a Comment RSS for this post |Trackback URL

How to Use HttpWatch on an Apple Mac

 February 10, 2012

We often get asked if we have a Mac version of HttpWatch. Unfortunately, the answer is no and it is likely to stay that way in the short term as it would take a significant amount of effort to port it to Mac OS X.

However, we decided to take a look if to see if there was a simple way to access HttpWatch on the Mac. Having used VMware extensively for testing HttpWatch on different versions of IE, Firefox and Windows the VMware Fusion product was an obvious candidate.

The result was much better than we initially hoped for. Vmware Fusion is able to run IE 9 and HttpWatch directly on the Mac desktop alongside other Mac applications:

We were even able to setup short-cuts to directly run HttpWatch Studio from the Dock allowing it to open HttpWatch log files or HTTP Archive files (.HAR) stored on the Mac file system.

The rest of this blog post describes how we setup VMware Fusion to run HttpWatch, IE and the Windows version of Firefox. Parallels Desktop for Mac also seems to have similar capabilities and could probably be setup in a similar way.

What do you need?

We used the following software:

  • VMware Fusion 4 – this costs $50 and has a 30 day trial option allowing you to try it out first
  • Windows 7 – you’ll need an installation CD/DVD or an ISO image and a valid license key. You could use older versions of Windows too

Setting up VMware Fusion and Creating a Windows Virtual Machine

Our setup was created by following these steps:

  1. Download and Install VMware Fusion on the Mac
  2. In VMware Fusion->Settings->General select the ‘Suspend the virtual machine’ option so that you don’t have to restart Windows every time you open the Windows Virtual Machine (VM)
  3. Start VMware Fusion and right click on the icon in the Dock. Then select Options->Open at Login to ensure that the Windows VM is available when you restart your Mac.
  4. Create a new Windows VM by going to File->New in VMware Fusion
  5. Either insert your Windows installation CD/DVD into an optical drive or click ‘Continue without disc…’ if you are going to use an ISO installation image
  6. Click Continue and then check that VMware Fusion shows the correct version of Windows.
  7. Click Continue and use the Windows Easy install option to setup the Windows administrator account and supply the Windows license key.
  8. Click Continue and select the level of integration required between Windows and Mac OS X. We chose ‘More Seamless’ as it maps the Windows documents directory on the Mac documents directory:
  9. Click Continue and run the Windows installation

Configuring the Virtual Machine

  1. In VMware Fusion select the Windows virtual machine and then click the Virtual Machine->Settings menu item
  2. In General click on ‘Start automatically when VMware Fusion launches’
  3. Optionally, you may want to allocate more CPU and memory resources to the Windows VM to improve performance. You can do this in the ‘Processors and Memory’ section of the Virtual Machine settings, but only if the VM has been shut down. On a 8GB Dual Core Mac Mini we assigned 2 processor cores and 2048 MB of RAM

Configuring Windows

Open the Virtual machine and interact with the Windows desktop to:

  1. Apply all the latest patches using Windows Update
  2. Download and install HttpWatch
  3. Optionally, setup Windows so that it automatically logs into the account you configured during setup. To do this follow the steps in described in http://channel9.msdn.com/Blogs/coolstuff/Tip-Auto-Login-Your-Windows-7-User-Account

Setting up Integration with Mac Desktop

Once you’ve got the Windows VM machine configured and running select the View->Unity menu item in VMware Fusion. It will close the view of the Windows desktop and run Windows applications on the Mac desktop. It even displays icons from the Windows system tray on the Mac menu bar:

You can then start Windows applications that you want to use (e.g. IE or HttpWatch Studio) by going to the VMware Fusion dropdown menu and typing in the application name or selecting it from All Programs:

The application’s window will then appear on the Mac desktop and its icon will be in the Dock. By right clicking on the icon you can permanently add it to the Dock:

VMware Fusion also applies the file associations found in Windows. That allows you to directly open HAR or HWL files on the Mac directly into HttpWatch Studio:

What about Performance?

Initially, we tried running VMware Fusion on a basic Mac mini with 2GB RAM. It was very sluggish at times; particularly when it first started up the Windows VM. However, a $ 46 memory upgrade to 8GB solved that issue allowing Windows applications to Start as quickly as native Mac applications.

We also did some comparisons, running page load tests with HttpWatch in IE 9 and Firefox 10. The performance of the Windows VM on the Mac wasn’t noticeably slower than a native Windows PC with a similar spec.