WatiN Performance Tips

We use WatiN for integration and user acceptance testing (UATs). These tests are the slowest part of our build process. We are obsessed with finding ways to make these test run faster. Here is a list of what we do to make our UATs run as fast as possible.

Use [...]

Integrating JsUnit with NUnit using WatiN

We have 500+ JsUnit tests on my current project. These tests are a very valuable asset to the team. Their true value is not realized unless they are integrated into our automated build process.
[Test]public void RunJSUnitTests(){ string testDirectory = ConfigurationManager.AppSettings["JsTestDir"]; ITestFileReader reader = [...]

Accessing Body from WatiN

We have added many WatiN tests over the last few weeks. Performance is becoming more important every day. Several of our tests must ensure that a class is present in a body tag.
protected void AssertSiteModeEquals(string mode){ StringAssert.EndsWith(mode, ie.Element(”body”).ClassName);}
This block of code took several seconds to execute. [...]

Story Telling with WatiN

We use WatiN for integration and user acceptance testing (UATs).Example
[Test]public void PageForwardButtonRendersNextPage(){ ie.GoTo(”http://localhost/offices/lists.rails”); ie.Link(”fwid”).Click(); Assert.AreEqual(2, int.Parse(ie.Select(”pgs”).SelectedItem))}
This version is not bad, but I have to think when I read it. This test has at least two problems.

HTML specifics have leaked into the test
Element ids (fwid, [...]

WatiN, Watir and Selenium Reviewed

WatiN, Watir and Selenium are three of the most popular open source web application testing frameworks. We tried all three frameworks during our current project.Why do we (or anyone else) need a web application testing framework (WAT)?A WAT provides two purposes for us.

User Acceptance Testing (UAT). UATs provide a defined ending [...]