The holy grail: .net automated web GUI testing for internet explorer

If you are looking (as I have been for a while) for a solution on how to write automated web GUI tests for internet explorer in .net then look no further. WATIR has been ported to C# as the WATIN framework. I have compiled the framework in .net 2.0 with minimal fuss, and it feels like it should have shipped out of the box with Visual Studio Team Edition for Software Testers.

So is it any good? I have spent about 2 hours so far converting one of my simple tests across, and this thing rocks. The tests are simple and execute very quickly. The following sample, copied from the WATIN homepage, searches for this site in google and checks for the text “Saving the world, one test case at a time” in the browser window.

    [Test]
    public void Google()
    {
      using (IE ie = new IE("http://www.google.com"))
      {
        ie.MainDocument.TextField(Find.ByName("q")).TypeText("Teknologika");
        ie.MainDocument.Button(Find.ByName("btnG")).Click();

        Assert.IsTrue(ie.MainDocument.ContainsText("test case"));
      }
    }

The best part of all, is that if you use NUnit and Visual C# Express Edition, your total cost is $0.

3 Responses to “The holy grail: .net automated web GUI testing for internet explorer”

  1. Mark Cohen Says:

    The timing of this post coincided so perfectly with us setting out to look for a tol like this. Thank you!

  2. Frederic Torres Says:

    Try InCisif.net.
    InCisif.net is an automation tool designed to implement client-side functional testing of web applications under Internet Explorer 6.x or 7.x, using the C# or VB.NET language with Visual Studio 2003, 2005 or express editions.

  3. Bruce McLeod Says:

    Or I could stick with the open source tool that is 100% free.

Leave a Reply