Go Watin!

February 14th, 2007

I’ve seen many selenium related posts recently and Henry and I thought it was a de-facto standard product to use for UI TDD and acceptance tests. We decided to embrace it to create tests for an existing functionality, to reproduce a bug we knew was there and had to be fixed, and to TDD a new feature.

Selenium is either brilliant or a big hack. Possibly both. It starts its own web server, and starts the selected browser to access it. From there it can “command” the browser through javascript to invoke things on your app’s DOM.

We didn’t like it. We just didn’t like it at all. The API wasn’t intuitive, every parameter is a string. It took us too much time to find a method as the API is basically a flat bundle of methods.

So we rewritten everything to use Watin. We’ve seen code being reduced, the API is a gazillion times better (I tend to exagerate), and the test run faster. There is room for improvements, though, but as a nice open source project they accept patches through the mailing list (and we are working on improvements)

If you’re new to Watin, check Web Application testing in .net.

Update: Chris Ortman pointed me to this blog entry. Really interesting!

Categories: TDD | Top Of Page | 5 Comments » |

5 Responses to “Go Watin!”

Simone Busoli Says:

Ok Hammet, WatiN is cool, but how do you deal with cross browser compatibility? When you’re testing visual features you’ll never know if your pages will run smoothly on browsers other than IE, maybe all your tests pass on IE and none passes on FF.

hammett Says:

Hi Simone,

Even if you use Selenium to test cross browser compatibility, you can only assert javascript functionality. That is important, but I still need to test if the app will look the same on IE, Firefox and Opera, and this I’d never be able to test on watin, selenium or anything that doesn’t have some great artificial intelligence built in.

I’ve also gave Selenium a try because it supported more than a single browser, but I don’t think that considering the pros and cons, it is worthwhile.

But hey, it’s just me talking.

Confluence: Development Says:

Web Application Testing

As we are in about to start testing our web applications (ANI Online) with automated regression test tools, these links would be very interesting: Selenium

Dan Bunea Says:


I will prepare early next week a version of my article Test First web apps with WatiN and publish it on my blog at first, and then maybe we can make a sample project with Watin tests inside the castle svn, so people can download it and look at it, or maybe add the tests for an existing project.


Jeroen van Menen Says:


Looking forward to the article!

Jeroen van Menen

Leave a Reply