Thursday 17 April 2008

Running WatiN with Cruise Control .Net

I've been doing a bit more work with WatiN lately to get some decent automated test coverage for our web application and everything was running all fine and dandy on my local machine (famous last words) but when the time came to move the tests into our continuous integration build environment I came across a bit of a problem, our cruise control runs as a service but WatiN launches IE, mmm a bit of a problem I think. Kicking off a cruise control build simply resulted in the build hanging for an extraordinary amount of time when the build previously took approximately 15 minutes.

So I did a bit of digging on the web and quickly came across a couple of people having similar issues, the first suggesting to simply set the "Allow interaction with the desktop" flag on the service, so I did this and tried again.

image

I restarted the service and kicked off another build and low and behold the tests started working, nice one.

Cheers

5 comments:

Anonymous said...

bravo

Anonymous said...

Hmm it appears that Allow service to interact with desktop is only available to local accounts. We run ccnet under a domain account so the build server has permission to push out the latest version of a database on a different server.

Richard Allen said...

Unfortunately this does seem to be a bit of a drawback of the whole interacting with the desktop on a Windows box, I've not come across any other way of doing this, however if you have a spare machine you could set it up as a second build machine and get the completion cruise control build on your first build box to trigger the Watin test build on the second build box which would be running under the local system account?

Brett said...

Found a work around for this: http://stackoverflow.com/questions/640273/watin-tests-fail-on-cc-net/1241329#1241329

Richard Allen said...

Nice one Brett, thanks for posting the work around, I shall give it a try.