Gui Testing Patterns

I haven't done any automated GUI testing in years, so only one pattern has really stuck in my head - the PalindromicFrameModel?.

Executive summary: if your application has UI layers ABC, then your test code has layers cba to talk to it.

Example: if your test needs to emulate a user opening a file, then the test calls an open file method, which calls a dialog class, which calls a button class, which clicks the button, which sends a message to the dialog, which passes the filename back to the app, which opens the file.

a -> b -> c -> ... -> C -> B -> A

In an unrelated confession, I'll add NeverBeAfraidToCheat?. I often found it easier to verify that a UI conformed to the style guidelines by examining the source code rather than the actual widgets - if you want to be sure that all the items in a list on a web page are spelled correctly, look at the HTML! -- DanilSuits

Agree. I HaveThisPattern, and call it "test under the skin". I'd rather not use sophisticated screen-scraping and robo-clicking tools to test my GUIs - not simple enough. I prefer to capture whatever "rules" of UI design apply to the current project in classes, methods, or symbols, and test for symbolic correctness. For instance, in a user story calling for a "resizable modal dialog" I'd want to code the acceptance test as assertTrue(window instanceof ResizableModalDialog?). -- LaurentBossavit

See GuiTesting, GuiUnitTesting, ThenDontCallMainLoop.


CategoryPattern


EditText of this page (last edited March 27, 2005) or FindPage with title or text search