Tag Archives: testing

WatiN supports Firefox!

Back in March I finished developing a release of the WatiN framework that enabled testing in Firefox in addition Internet Explorer (already supported). This was the first time I’ve been involved in collaborative open source development. I worked with Jeroen van Menen, the creator of the WatiN project using Basecamp for project management and sourceforge svn for source control. It was also my first time using Basecamp which worked out pretty well for us. It’s simplicity is what I like. You basically just manage a bunch of grouped lists:

WindowClipping (11)

WindowClipping (12)

Anyhow… It’s now pretty straight forward to make a unit test execute under both IE and firefox

[Test] public void SearchForWatiNOnGoogleVerbose() { using (IBrowser ie = BrowserFactory.Create(BrowserType.InternetExplorer)) { ie.GoTo("http://www.google.com"); ie.TextField(Find.ByName("q")).Value = "WatiN"; ie.Button(Find.ByName("btnG")).Click(); Assert.IsTrue(ie.ContainsText("WatiN")); } using (IBrowser firefox = BrowserFactory.Create(BrowserType.FireFox)) { firefox.GoTo("http://www.google.com"); firefox.TextField(Find.ByName("q")).Value = "WatiN"; firefox.Button(Find.ByName("btnG")).Click(); Assert.IsTrue(firefox.ContainsText("WatiN")); } }

It’s also quite trivial to collapse these two using constructs into a single chunk of code for better maintainability etc..

Check out the WatiN Firefox Community Technology Preview for more information.

Tagged , ,