Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Tutorial: TDD with Selenium and Castle

Tutorial: TDD with Selenium and Castle


In this InfoQ tutorial Dan Bunea shows developers how TDD can be applied in .NET using Selenium RC and Castle. Selenium is an automated test harness for building enterprise class web user interafaces written in any programming language.  Castle is an open source project dedicated to providing libraries to ease the enterprise application development process for .NET based applications.

Test first principals provide architects a way to quickly jump into active development early in the application development lifecycle.  Design of the application takes place as development occurs and obviates the need to design the application before the actual coding process begins.  This provides the architect with flexibility to respond to new and changing requirements as the application lifecycle evolves.

The benefits of TDD are a drastic reduction in defects as well as increased adaptability in the code base since the application advances quickly through an iterative process.  For each iteration developers must first create the tests their code must pass before they write any actual code. The iteration finishes with a period of refactoring dedicated to simplicity and flexibility.  Adherents claim TDD is a code tempering process allowing them more time to program and concentrate on writing quality applications.

What have been your experiences with TDD?

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Your message is awaiting moderation. Thank you for participating in the discussion.

    TDD is always healthy for all projects as almost all projects deploy different version/variations of frameworks, drivers etc in production than what they started for development. Also, in typical infrastructure, there are always one after other upgrades (Service Packs, new versions, new softwares etc). TDD will reduce stress of development team to large extend in above scenarios. But all softwares are ready for TDD?, Current BPM tools are not test friendly.

  • Firefox and HTTPS plug-in problems?

    by Frank Cohen,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Selenium looks like a very nice plug-in to help make test script creation easy. I maintain the TestMaker open-source SOA test automation tool and we long ago embedded a branch of the MaxQ proxy recorder to make script creation easy. Recording proxy servers work well for HTTP but require a lott of extra "stuff" to work with HTTPS. One of our users recommended we write a FireFox plug-in like Selenium and he added that Selenium was encountring problems with HTTPS too. Is there anything too that?

    -Frank Cohen

  • Re: Firefox and HTTPS plug-in problems?

    by Patrick Lightbody,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    We (the Selenium guys) actually solved HTTPS a couple of months ago, but we haven't gotten off our lazy butts to put out a release. We're narrowing in on a single "mode" of Selenium RC that can handle all cross-domain and SSL traffic, becoming the one-stop shop for web testing.

    I'd love to chat with you some more about Selenium if you'd like. Feel free to email me at


  • Re: TDD

    by Deepa Jain,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Wat if I am not using .NET .Can this be done using simply HTML If Yes then plz tell me

  • Great tutorial but source code link's broken

    by Stefan Marev,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Great tutorial. I know it's been a while since the article was published but the download source code link is broken.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.