Loading...

Web Application Testing : Mature Edition

I've been intrigued with the concept of testing software for quite some time. Unfortunately, the team I work with at my employer is so small that we hardly have time to write tests for everything we've needed. This means that my experience with testing software has been solely on personal, non-critical projects. I've read books and blog posts and entire mailing list threads on the topic of application testing with fascination. The one thing I've seen lacking is information on testing web applications. It seems the mentality of web applications is that since web applications are all written in Java, we can just use any of the Java testing suites. I hope you see the problem....

Yesterday, I stumbled upon Grig Gheorghiu's blog post about his new O'Reilly e-book An Introduction to Testing Web Applications with twill and Selenium which I went out and purchased, mostly because the price was right. I figured if the book sucked, it was a $10 loss. I'd never purchased an e-book before, but it was a subject that appeared to be something I'd definitely be interested in.

I've played with Selenium before, but I didn't find it to be incredibly useful, and I could never get the Selenium Remote Control to work right. I'd heard about twill, but I had never actually experienced it. After having downloaded and written tests in twill, I can see it's exactly what I've been spending a lot of time writing : a DSL to wrap Python's mechanize module for web testing. The limitation I had with twill was with pages that were AJAX driven, because it couldn't interpret Javascript. That's why the combination of twill and Selenium is so great. Because Selenium runs in your browser (it's got a Firefox extension...), it allows the browser to execute the Javascript, thus giving Selenium access to dynamically created DOM elements.

While I haven't quite finished the whole "book" yet, I'd highly recommend it to anyone who's tired of writing new features for their web applications, and fearing that they may be breaking other functionality at the same time. After subscribing to the testing-in-python mailing list, I cannot stress enough the importance of testing, testing, and more testing.