If you need to automatically test a user interface, this book is for you. Whether it’s Windows, a Java platform (including Mac, Linux, and others) or a web app, you’ll see how to test it reliably and repeatably.

Many automated test frameworks promise the world and deliver nothing but headaches. Fortunately, you’ve got a secret weapon: Ruby. Ruby lets you build up a solution to fit your problem, rather than forcing your problem to fit into someone else’s idea of testing.

This book is for people who want to get their hands dirty on examples from the real world—and who know that testing can be a joy when the tools don’t get in the way. It starts with the mechanics of simulating button pushes and keystrokes, and builds up to writing clear code, organizing tests, and beyond.

eBook

This version, last updated Jan 2012, refreshes the RSpec examples for version 2.x. It also contains an updated section on narrative-style tests, based on Cucumber 1.x. Ian has tweaked code samples throughout the book for compatibility with Ruby 1.8.7, Ruby 1.9.2, or JRuby 1.6.5, based on what the underlying libraries support.

Buy Now

Select a DRM-free Format:

In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • PDF
  • mobi (for Kindle)
We can automatically send them to your Kindle, and your Dropbox. (You'll need to log in to enable these options.)
 

About this Book

  • 176 pages
  • Published:
  • Release: P1.1 (2012-01-25)
  • ISBN: 978-1-93435-618-0

Scripted GUI Testing with Ruby is a practical, quick-moving tutorial based on real life, and real-world GUI applications.

Right out of the gate you’ll start working with code to drive a desktop GUI. You’ll discover the kinds of gotchas and edge cases that don’t exist in simple, toy programs. As you add more tests, you’ll learn how to organize your test code and write lucid examples. The result is a series of “smoke tests” your team will run on Continuous Integration servers.

Next, we’ll explore a variety of different testing tips and tricks. You’ll employ a series of increasingly random and punishing test monkeys to try to crash programs. Table-driven techniques will show you how to check dozens of different input combinations. See how to use longer acceptance tests (in the form of stories) to represent the way a typical customer would use your program.

The book uses examples from Windows, OS X, and cross-platform Java desktop programs as well as Web applications. You’ll develop test scripts in Ruby; you don’t need to be a Ruby expert, but basic comfort with the language will be helpful.

Contents and Extracts

Full Table of Contents
  • Introduction
  • One Big Example
  • Aspects of Testing
    • Branching Out
    • Keep ’em Guessing: Introducing Randomness
    • Keys, menu or mouse
    • Turn the Tables: Matrix Testing
    • Testing the Tubes: Web Applications
    • Interacting with AJAX
    • Testing in Plain English: Cucumber
    • One More Thing: Testing on the Mac
    • Other Windows Techniques
    • Resources

About the Author

Ian Dees was first bitten by the programming bug in 1986 on a Timex Sinclair 1000, and has been having a blast in his software apprenticeship ever since.

Since escaping Rice University in 1996 with engineering and German degrees, he has debugged assembler with an oscilloscope, written web applications nestled comfortably in high-level frameworks, and seen everything in between. He currently hacks C++ application code, automates laboratory hardware, and yes, writes user interface test scripts for a test equipment manufacturer near Portland, Oregon.

When he’s not coding for work or for friends, you’re most likely to find Ian chasing his family around on bicycles, plinking away at his guitar, or puzzling at the knobs on the espresso machine while some impromptu meal simmers on the stove nearby.