Hanselminutes podcast on functional web testing tools

Scott Hanselman's podcast #10 is on functional web testing tools http://www.hanselminutes.com/default.aspx?showID=11

After listening to it I only had a few comments. Scott hadn't played with the new Visual Studio Team System web tests so he doesn't really talk about it much. I haven't used it much either, but it would fit into his category of HTTP traffic recorders. It doesn't test in the context of the browser like many of the other tools he listed. At first glance I would generally agree with his assessment that it's ACT on steroids. Looks like it will be great for load testing.

I'm personally a big fan of the SWExplorerAutomation tool he touched on. One thing Scott didn't mention that I wanted to point out was a feature that allows you tweak your tests so they continue to work despite structural changes you make to your pages.

By default this tool does record via a positional XPATH. For instance it may record the following XPATH address of an input button.

HTML[1]/BODY[1]/FORM[1]/TABLE[1]/TBODY[1]/TR[4]/TD[2]/INPUT[1]

But if the structure of the page changes, as Scott noted, your XPATH indexes might be off, and you would have to go in and either re-record the scene, or mess around with the XPATH.

BUT by using XPATH, Alex Furman has enabled a more robust way of addressing controls that won't be so fragile. It isn't automatic, but you can easily modify the site structure file to address controls using some other scheme such as ID or text()

HTML[1]/BODY[1]/FORM[1]/TABLE[1]/TBODY[1]//INPUT[@id='MyControlId']

Or if you were going after a Logout link you might address is like this:

HTML[1]/BODY[1]//A[text()='Logout']

I've found this extremely handy for making tests resilient to change.

Some other things I like about SWExplorerAutomation:

  • It separates the structure file from the script file so you can record the site structure once, and record many scenarios against it.
  • It saves its structure file and script file in plain old XML. It was trivial to write an XSL stylesheet that transforms the script file into an NUnit C# test class.
  • It lets you write your tests in .NET rather than having to learn a new programming language.
  • Alex is a darn nice fellow and extremely responsive to feature requests

No Comments