InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

WatiN: Web Application Testing in .NET

Posted by Al Tenhundfeld on Feb 18, 2009

Sections
Development,
Architecture & Design
Topics
.NET ,
Software Testing ,
Unit Testing
Tags
Acceptance Testing ,
WatiN

WatiN is an open-source library for automating web browsers using .NET. WatiN, inspired by the popular Ruby-based Watir project, facilitates automated testing of web applications through browser interaction. WatiN is written in C#, but tests can be expressed in .NET language. Windows is the only supported platform.

Version 1.0 was feature-rich in comparison to most other .NET solutions and moderately popular as a user interface and user acceptance testing tool, but without customization, it only supported automating Internet Explorer. Though still in development, version 2.0 of WatiN supports automating IE and FireFox 2.0 & 3.0. The new community technology preview, WatiN 2.0 CTP 3, was released on February 11th.

CTP 3 is focused on increasing support for FireFox and includes the following changes:

  • Implemented support on Mozilla.Frame to get access to elements inside the document of a Frame
  • Implemented support on Mozilla.Frame to get access to elements inside the document of an IFrame
  • Implemented Eval on Mozilla.Document (= FireFox and Frame) and added to the IFrame interface
  • Fixed bug that caused Form.Submit not to wait for a possible postback and page load in some circumstances

WatiN relies on browser interaction and uses DOM manipulation and verification to assert conditions, but WatiN 2.0 has an abstraction layer that facilitates writing cross-browser tests. The following code sample shows a simple example that searches for WatiN through Google and asserts that "WatiN" is included in the results. The IE test and FireFox test could easily be refactored to a single test that works against either browser.

Because writing WatiN tests by hand can be tedious, another open-source project exists to record WatiN tests in a browser. WatiN Test Recorder does not have a new release available, but version 2.0 is currently in development and promises major enhancements.

This thing is awesome by Francois Ward Posted
More than a test framework by Zhao jeason Posted
  1. Back to top

    This thing is awesome

    by Francois Ward

    While none of the places I worked for seemed interested in doing this (usually thinking unit tests were already enough "work"), I've been following it pretty closely, as a way to do full regression and integration testing on QA/UAT servers. Hope they keep up the good work until the day I do get to use it!

  2. Back to top

    More than a test framework

    by Zhao jeason

    I think this tool is more than a test framwork, we can use it to access Internet pages replaced HttpClient class.

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.