+1  A: 

There should be no significant differences testing a website on locahost.

Two possible causes:

  1. If your webpage contains any significant AJAX then it's possible that the page never appears to be fully loaded so WatiN just keeps waiting.

  2. I have fixed one or two bugs in WatiN now and then related to detecting that a page has been fully loaded. You might try grabbing the WatiN trunk source and building a fresh copy of the latest code.

If none of that helps, WatiN also has "NoWait" variants of several actions like clicking. You can also override what it means to WatiN to wait for a page to be complete by registering a WaitForComplete handler.

Jeff Brown
I agree totally; I can't see why this website should be any different, especially as it's a published (output) site anyway! But am usingn the latest version of WatiN, as I only downloaded it yesterday.
Brett Rigby
But no, there's no AJAX going on - it's the homepage of an MVC web application with nothing more exciting than a CSS page dragged in at the top.
Brett Rigby
Also, I;ve just checked the file I downloaded - it's WatiN-2.0.10.928-net-2.0.zip from the sourceforge website. Is there a newer codebase available?
Brett Rigby
That beta is pretty old. Gallio v3.1 Update 1 ships with a newer version as part of its WatiN samples. You can also build your own from the WatiN trunk. I know Jeroen is working on getting a fresh release out but it's not ready yet.However @orip's comment about having a reference to a missing resource is a good one.
Jeff Brown
+1  A: 

I've had this happen to me when I had a reference to a resource that didn't load.

  • Do have a reference to a JS, CSS, or image file that doesn't exist?
  • If you look at the HTTP traffic with Fiddler do you see any connections timing out?
orip
A: 

Make sure the program is running as an administrator. On Win7 it will load the page but Watin can't access the DOM unless Visual Studio or Gallio Icarus are started with administrator privileges.

Greg Bray