Functional Web Testing with twill

A brief history of twill

(by C. Titus Brown)

I first began looking for a way to automate web testing in 2003. I had two unmanageably large web sites being used by hundreds of people, and my default testing strategy for them was to add new features, make them public, and wait for bug reports. This wasn't very satisfactory for either me or the users, needless to say!

Around that time, I ran across Cory Dodt's PBP, a web scripting language built on top of John J. Lee's mechanize package, which let Python "speak" HTTP and understand web pages. (John's mechanize package was a Python port of Perl's WWW::Mechanize, and PBP looked somewhat like Perl's WWW::Mechanize::Shell.) Unfortunately, at that time PBP was in its very early stages and didn't work very well on my web sites.

In late 2004, I decided to investigate PBP again, because I really needed to write some automated web tests. By then PBP had matured considerably, and it got me about 90 percent of the way to a web testing solution for my web sites. I started submitting patches to Cory to make it a 100 percent solution. Eventually, however, we realized that Cory was interested in taking PBP in a different direction. I'd also become disenchanted with PBP's architecture, which relied on the sprawling Twisted library for certain functions. (PBP was born as a way to write functional tests for twisted.web, so this inter-reliance wasn't surprising.)

I set out to rewrite PBP from scratch. My initial rewrite used ...

Get An Introduction to Testing Web Applications with twill and Selenium now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.