How do I Cancel Thee? Let Me Count the Ways

What’s wrong with just stating “when prompted, cancel request” in your test case? Well, just think about the ways in which a dialogue box can be dismissed:

* click the close box (if present)
* click the [Cancel] button
* press escape
* press tab until the [Cancel] button is highlighted then press space
* press tab until the [Cancel] button is highlighted then press enter
* press tab until the [Cancel] button is highlighted then press return
* press alt-c or whatever letter in “Cancel” is underlined when alt is held down (if present)

Do you test each of the seven ways with each dialogue box you see? Why not? Because they all do the same thing? Well, one of the methods might trigger something the others do not (and yes, it has happened to me). Then again, even if I did adhere to these strict methods there might be yet another legitimate way of hitting [Cancel] that I’ve never thought of.

But a man can become paranoid. Clearly you have to be realistic in how you test and that will only come with experience. Don’t sweat the small stuff and don’t get bogged down in detail. Let’s take another look at these seven methods of invoking [Cancel]. They can be split into two groups: those triggered by mouse action and those triggered by the keyboard. Suddenly not so daunting.

Leave a Reply