Posts

Showing posts from January, 2006

Agile 2006 tutorial proposal submitted

Encouraged by the large number of people who signed up for our PyCon tutorial (and from whom we're still waiting for feedback on the outline), Titus and I just submitted a tutorial proposal for the Agile 2006 conference. While similar to the PyCon tutorial, it has some more emphasis on general agile development and testing techniques as opposed to Python-specific tools. Here is the proposal, in case you're interested. We'll find out by March 30 if it was accepted or not.

=== Presentation title ===

"Agile Web Development and Testing"

=== Author names and contact info ===

Grig Gheorghiu

Email: grig at gheorghiu.net

Web site: agiletesting.blogspot.com

C. Titus Brown

Email: titus at caltech.edu

Web site: www.advogato.org/person/titus

=== Topic ===

We will present a Python Web application that we developed together as an "agile team", using agile development and testing approaches, techniques and tools. The value of the tutorial will consist on one hand in detailing t…

Are unit tests free when TDD-ing?

Interesting post from Cory Foy, who quotes William Petri. More ammo for people who are trying to convince their colleagues/bosses/etc. that you don't waste, but on the contrary you gain time when you do TDD -- or TED (Test Enhanced Development) as I dubbed a variant of it: write some code, write unit tests for that code, then write more code, then more unit tests, etc.; note that the person writing the initial code can be different from the person writing the initial unit tests.

W.A., the one and only

...that would be Mozart, whose 250th anniversary is today. Mozart trivia for today: he was baptized as "Johannes Chrysostomus Wolfgangus Theophilus". I guess Amadeus sounded better than Theophilus, while conveying the same idea. In any case, as they say, if Mozart didn't exist, he should have been invented -- he's up at the top in my Classical Music Hall of Fame. I like a quote from an article in today's L.A. Times: "As pianist Artur Schnabel observed, Mozart is too easy for children and too difficult for artists."

Useful tools for writing Selenium tests

I've been writing a lot of Selenium tests lately and I've been using some tools that I find extremely useful for composing table-style tests. Let me start by saying that writing GUI-based tests for Web apps is no fun, no matter what your testing tool is. You need to navigate through pages, fill and submit forms, and verify that certain elements are present on the pages. Doing all this manually can quickly become tedious and kill whatever joy you may find in testing.

If you're writing Selenium tests, these activities are, if not fun, at least tolerable due to the existence of the Selenium Recorder ("the Selenium Recorder -- can't imagine life as a Web app tester without it" seems like a good line for a commercial :-)

The Selenium Recorder (which I'll refer to as SelRec from now on) is a Firefox extension that you launch via the Tools menu. It intercepts Web browsing actions such as opening a URL, clicking on a link, entering text in a field form, selecting a…

PyCon tutorial outline feedback

For people who registered for the "Agile Development and Testing in Python" tutorial that Titus Brown and I will present at PyCon06, we put together a Wiki page with the current outline of the tutorial. If you will be attending the tutorial, please feel free to edit the page and add comments/suggestions on stuff that you would like to see covered at the tutorial.

SoCal Code Camp presentation

The SoCal Code Camp event took place yesterday and today. I presented an updated version of my PyCon '05 talk, "Agile Testing with Python Test Frameworks". When I submitted my talk proposal, back in October '05, I had no idea the Code Camp will be so much Microsoft-centric. At the time, it seemed like a get-together of coders of all kinds. However, it seems that a lot of Microsoft user groups got involved in the organization, with the inevitable result that it felt like a Microsoft-sponsored event (which it might have been, for all I know). To be fair, the schedule did include a number of Java talks, but it did feel like the overall tone was of the "ode to Micro$oft" type.

Anyway, my talk attracted no less than 5 people! Pretty amazing, isn't it? Joking aside, as the common wisdom goes, if only one person took something away from it, even then it means my goal was met, etc., etc. I did have time to demo Selenium, so I hope that people took that away at l…

Ambition and the 25% rule

I finished reading "Ambition", a book by the sociologist Gilbert Brim. One thing I took away from the book is that we humans seem to be most happy when we're faced with what Brim calls "manageable difficulties" -- challenges that are neither too easy (because then we become bored), nor too hard (because then we become discouraged/depressed). Brim says that humans are driven towards mastery and achievement in whatever field they set their eyes, or minds, or souls on. We are an ambitious kind, always striving to do better, not only in ordinary careers, but also when we meditate or when we walk on spiritual paths, supposedly getting away from it all. In all cases we will try to do our best to achieve mastery.

Brim cites the "25% rule", discovered by another sociologist whose name I forget. The rule states that no matter what level of income we achieve, we instantly shoot for 25% more. Brim says that he suspects this rule holds true not only when it comes …

Testing Commentary (and thus Ajax) with Selenium

I've been working on adding Selenium tests to the application that Titus and I will be presenting at our PyCon tutorial in February. Titus included Ian Bicking's Commentary functionality into our app, and of course the challenge was how to test this stuff. If you visit the live Commentary page and double-click anywhere on the page, a form magically pops up (Ajax stuff, of course) and allows you to enter and save a comment. The challenge of course was how to fire the mouse doubleclick event in Selenium. After a lot of pain, mostly involving searching through the messages posted to the selenium-dev and selenium-users lists at OpenQA.org, I came up with a solution. It's not pretty, but it does the job well enough.

I can't show you a live demo yet, but here's what I did to get it to work.

I extended the selenium-api.js and selenium-browserbot.js files and added functions dealing with mouse doubleclick events. This basically added a new dblclick command to the "Selen…

Recommended blog: Adam Goucher's Journal

Via Greg Wilson, I came across Adam Goucher's Journal. Many interesting posts on QA/testing.

Running Selenium in Python Driven Mode

Image
Update August 2007

For people who are stumbling on this blog post via searches: this post is outdated. There is no Python Driven Mode' in Selenium anymore. Instead, you should use Selenium RC, which offers the same capabilities and much more.

Original post:

I blogged about this before, but here it is again, in a shorter and hopefully easier to understand format. This post was prompted by questions on the selenium-users at openqa.org mailing list on how to run Selenium in Driven Mode using Python. By Driven Mode, people generally understand scripting Selenium commands as opposed to writing them in HTML tables. Scripting offers obvious advantages, such as real programming language constructs and idioms.

Here is a step-by-step HOWTO on running Selenium in Driven Mode using Python. I just tried on a Windows XP computer (see this blog post of mine for details on running it on *nix):

1. Download and install Twisted version 1.3 (this is important, because things have been known not to work so…

PyFit finally at the CheeseShop

John Roth, the PyFit developer/maintainer, finally uploaded the latest version of PyFit to the CheeseShop. PyFit is the Python port of the FIT framework initially created by Ward Cunningham. PyFit also integrates with the FitNesse framework, so you get the best of both worlds. I wrote a series of PyFit/FitNesse tutorials which you can read here.

I'm currently writing PyFit functional/acceptance tests for the application that Titus and I will present at our PyCon tutorial. Writing acceptance tests as Wiki pages peppered with test tables is a very effective way of both documenting the desired behavior of the software and testing it at the same time. The FitNesse tests serve as an alternative GUI into the application. They test it at the "business logic" layer, which means that they are much more robust in the presence of GUI changes. See this post of mine for some thoughts on running FitNesse vs. Selenium tests. For a great series of articles on Agile Requirements and Fit-s…

Xooglers and Python

Selenium at OpenQA

I blogged about this before, but I want to respond to a call to arms on the selenium-users mailing list that was asking people to link to the new home for the Selenium project: OpenQA.

Some useful links:
Selenium command referenceSelenium WikiWiki page for Contributed user extensionsBTW, Happy New Year 2006 everybody!