I'm pumped that no super cool announcements came out of Steve's Keynote today. I dig that they've just enhanced my favorite Mac apps (iLife). If they would have announced new PowerBooks or cheaper displays, I could easily justify an upgrade... and my budget couldn't. So I say, "Thank you Apple. Thank you for not tempting me."
I should start this by saying that I love Canoo's WebTest. It allows you to test clicking through your webapp as if you're using a browser. You simply write your tests in an XML file (which is really an Ant build file), and then run it with Ant. Usually, in my webapps, I write simple tests for CRUD on entities - i.e. EditUser (tests pulling up the edit screen), SavePosition (edit and save, verifies next screen's title), SearchUsers (verifies list screen's title).
One of the issues I had this morning was testing a wizard with WebTest. This was because I didn't know how to get the id of the new record after it was added. Now I found a way. Let's say you have a Create a Job wizard. On the first screen, you enter the job, and on the second, you add the required skills, on the third, you view a summary. To get the new id of the job, you can use XPath to get the hidden field named "jobId" - to do with what you may (i.e. click on a link to the third screen). Here's how:
{{{
}}}
This is especially helpful because I tend to use a lot of onclick handler's (with location.href's) on buttons (so I don't have to submit to the same action). I also turn off JavaScript for my tests - by not including js.jar in WebTest's classpath. I can't say enough about this tool - the ability to test your app, with JavaScript turned off, and verify that everything works... that's just cool. Especially when you're a JavaScript junkie like me.