Wednesday, August 6, 2008

RSpec Stories and WATIR (Web Application Testing In Ruby) - Part 1

I used WATIR in my last project for automation testing. I started writing tests in RSpec framework. But then I came across the RSpec Story framework which convinced me as the appropriate way to write readable automation test scripts.

I wrote tests from top to bottom. I wrote story and its scenarios first and then its implementation. Since the stories were written in pure English, my product owner could contribute towards writing the stories. According to me, following are the advantages of using story framework:


  1. Executable tests in pure English

  2. BAs and Product Owners can write test scenarios

  3. Tests are written in DSL (Domain Specific Language)

  4. Tests are maintainable

Since I work in a onsite-offshore model, a lot of time is spent on daily calls between the two groups. Out of the 250 people at offshore, not many get a chance to evaluate and work on new technologies. On top of that, people are always resistant to change. I am working towards adopting WATIR and story framework in other projects in my organization. I find promotion of WATIR and changing the mindset of people a bigger challenge than learning WATIR.

Check out my recommendation for WATIR and stories on OpenQA

I have created a screencast demonstrating WATIR scripting and story framework. I will post it soon.