Tutorial :WatiN Compatibility with Windows


I am running tests successfully on Windows XP but not even got a single successful build while running through Windows 2003.

Any one knows whether it is compatible or not as I read on some site that WatiN is fully tested on XP and not on other Windows editions.


I'd ordinarily post this as a comment on Sam's answer, but I'm trying to make a stack trace searchable, so here goes...

WatiN.Core.Exceptions.IENotFoundException : Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds.  at WatiN.Core.IE.CreateIEPartiallyInitializedInNewProcess()  at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)  at WatiN.Core.IE..ctor(String url, Boolean createInNewProcess)  c:\...\WithVendorSite.cs(42,0): at WithVendorSite.VerifyCanLogIn(TargetSite target)  

I developed my test on Windows 7 against WatiN but the test was continually getting stuck with a blank browser with about:blank in the address bar when run on Windows Server 2008 with latest WUs, and Enhanced Security Configuration turned off and running the tests elevated (Run as Administrator).

The problem in my case (thanks Sam) was the absence of Microsoft.mshtml.dll in the bin directory (I had figured out Interop.shdocvw.dll was necessary from error messages I'd encountered on the Windows 7 side).

After adding Microsoft.mshtml.dll, things run happily with ESC turned back [but the test process needs to run elevated].


I run our WatiN integration test suite (hundreds of tests) on Windows 2003 with IE6. Works fine, no special tricks done. What is the exception you are getting? Are you sure mshtml.dll (the COM dll somewhere in the windows directory) is registered correctly on this machine? Do you have the Microsoft.mshtml.dll (interop assembly) and interop.shdocvw.dll in the same directory as WatiN.Core.dll?


Update: Its officially supported, from the faq

Which windows versions are supported?

Windows 2000, Windows XP, Windows 2003 and Windows 2008.

Original post:

I use it on vista all the time. I haven't used it on windows server 2003 though.


Have you tried logging on interactively into the server and trying to run the tests manually? It may be because of the account that your build server is running under or some particular security settings you have setup. Have you checked to see if IE is stopping you from viewing the page due to it not being in the trusted sites list?


I was using Watin 1.3 on Windows XP but the same on Win 7 having problem.... Officially Watin 1.3 works on O.S. Xp and earlier on Win XP

But Watin 2.1 works fine on Win 7 and XP. Officially Watin 2.1 supports any Microsoft O.S.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »