Seattle Software Developers


Pugetworks Blog Archive!

Selenium and frameworks

In what has been my best experience with automated browser testing, we have each element defined like three times.  Once in the jsp, once in the action mapping, and once again in the selenium Page Object.  I'll leave it to a better framework to get jsp and action classes sorted out, but what if a framework actually expected to be working with Selenium (or similar) and had as its intent to be designed for testability?

In the case of non-dynamic pages, this is pretty trivial -- IDs where possible, etc.  It gets more interesting when you start to look at AJAX pages.  One of the major problems with automating AJAX testing is knowing when you should expect something to be in place.  A framework with well-understood 'done' events that were able to be captured by Selenium would be powerful.  Even more powerful if the definition of the page elements and actions for the actual page rendering created (via runtime interpretation or compile time code generation) the Page Objects needed to test those pages.  Bake that into a BDD parser and you've got some powerful hotness.

Core here is that part of the definition of excellence of the testing framework is that it should be easily testable.  This idea could spread to all frameworks pretty easily.

Could somebody please build that and send me a link?  Thanks.