I know I'm late to this, but I'll share anyway:
If you're actively developing or supporting anything with a web front end, take a look at watir for automated smoke and regression tests. The site has a "watir in 5 minutes" page, but probably really takes more like 3, it's that well designed.
Watir stands for:Web Application Testing in Ruby. It is:- Open source
- Simple to install: just a ruby library (gem)
- All of ruby is available when writing test scripts
- Well regarded
- Widely used. Here's a partial list:

Watir Limitations
- “W3C” web only!
- No recording
- Recording tools are available, but not part of the core effort
- No plug-ins (active-x, flash)
- Widely used
- Very easy to use
- Programmer friendly
- Ruby is sane
- Terse without being obtuse
- You can debug scripts interactively using irb
For example, this screenshot shows a section of a browser wind and an irb window about to execute a method to click on the browser's edit button:

resulting in:

Page elements are referenced by
- Type and Id/displayed-text/link destination etc
- or Index
- @browser.select_list(:id, 'StatusSelect')
- @browser.buttons[3]
- Index is obviously not the preferred approach, but it is occasionally necessary, e.g., for pages with four identical “submit” buttons
On a maintainability note: I recently had to change a script from FireFox (which I'm increasingly becoming disenchanted with) to Chrome. The change only required altering 2 lines of code
#require 'firewatir'
require "watir-webdriver"
and
# @browser = Watir::Browser.new
@browser = Watir::Browser.new(:chrome)
However, I did find the behavior a bit different between Chrome and Firefox: If a button wasn't visible on the page Chrome wouldn't click it. I never had a issue with this in Firefox.
Update:, upon further investigation it appears that may be the behavior of the newer versions of watir, rather than a Chrome compatibility issue.


0 comments:
Post a Comment