This document discusses building test automation frameworks using Selenium. It covers several stages of framework development including initial record and playback (#0), adding utility classes (#1), dealing with localization challenges using data providers (#2), improving performance through parallelization and browser session reuse (#3), increasing stability (#4), implementing page objects (#5), handling mobile testing (#6), and principles for growing the framework (#7). Key lessons learned include following design patterns, making tests data driven, adding documentation, and refactoring is inevitable.
An Anti-Pattern is a pattern that tells how to go from a problem to a bad solution that is usually ineffective and counter-productive.
Anti-patterns
Global variables
Singletons
Hardcoded variables
No actual framework
Utility code sits in a bunch of utility classes
Everybody knows everybody: utility classes know global variables, global variables are mixed with logic that calls utility classes etc.
A test suite that has been running for 6 months will require a few hours a day to debug.
Data driven
+
Example for suite type data provider reduction.
Data provider as factory.
As code gets more complex, it also becomes less obvious.
Why reuse? @After methods are not really running … right after… just kinda…
a.k.a. Tests run painfully slow
Think macro, not only micro.
Unstable tests means debugging, and debugging is expensive.
Culture of stability
Design patterns
Make failures cheap
Who’s your client?