STAQS Software Testing and Quality Services
[ Lessons Learned ] > Ruby

Lessons Learned working with Ruby

NOTE: This page was added in April 2009.  It is under construction.  Feedback welcome.  Please just keep in mind that I know much needs to be updated here.  Thanks.

Contents:

Ruby:

  1. Quick Overview
  2. Ruby Scripts
  3. Scripting Tips

WATIR:

  1. Quick Overview
  2. Test Framework Components

Quick References:

Ruby Language Reference Sheet for Testers (PDF)

WATIR Reference Sheet (PDF)

 




RUBY

1. Quick Overview

If you are interested in Ruby, there are many sites and resources available to help you learn more.  Some include:

There are many, many other libraries, frameworks and add-ons to Ruby that help it do just about anything.  Just look around.

2. Ruby Scripts

Examples of Scripts that I've written include:

3. Scripting Tips

Do you know the difference between single quotes and double quotes when working with strings in Ruby scripts?

..coming soon..
 




WATIR

1. Quick Overview

Some helpful Watir resources include:

2. Test Framework Components

The foundation of testing web apps with Watir is made up of 3 parts:

  1. Ruby is a powerful, easy-to-use object-oriented scripting language that runs on all the popular operating systems.  Best of all, it's free! 
  2. Watir (pronounced 'water', not 'wa-teer') is a Ruby library used to automate Internet Explorer.  You install this separately.  It can be used to test all types of web applications (ASP, .Net, JSP, PHP, Rails, etc.)
  3. Test/Unit framework or library comes with Ruby.  It provides: (1) the structure for the test methods/cases, (2) the assertions (i.e. verification check points), and (3) some built-in summary metrics on things like number of tests performed/failed and length of time to complete.

Download the Ruby and Watir one-click installers from: http://wtr.rubyforge.org/

The thing to note here is that many people test with Ruby all the time but don't use Watir (i.e. using just 1 & 3 above), and you can use the Watir library to talk to web apps without necessarily testing them.  There's flexibility in how those 3 elements above can be used together, separately, or interchanged with other components.  The above combination for the purpose of testing web apps from a user's perspective is the purpose I'm interested in here.

Depending on your particular testing project's needs, you might also need to use other Ruby libraries.  For example, to help you read/write to Excel spreadsheets, parse XML, or use an additional scripting framework - e.g. like RSPEC.




Have a question?  Think something is missing?  Drop me a line to let me know.


Home Software Testing Primer [ Lessons Learned ] My Presentations Blog Distractions

Contact me at: paul [at] staqs [dot] c o m