May 11, 2010

Test-driven development with QA Wizard Pro and WPF

Helix ALM
Test-driven development (TDD) methodologies advocate writing unit tests before making your code functional. If you practice TDD, wouldn't it be great if you could easily create user interface tests in addition to your unit tests? QA Wizard Pro's new WPF support can extend this test-first development model to user interfaces. You can write your user interface tests before the user interface is functional, just like you do with your unit tests.
  1. Prototype your WPF user interface in XAML, assigning names to the controls you wish to automate. WPF assigns each control an Automation Id based upon the Name property in your XAML. Automation Id is made especially for user interface automation and QA Wizard Pro will recognize it. Of course, QA Wizard Pro will work even if you don't assign control names, but by doing so your scripts will be more resilient against rearranged controls during the development process.
  2. In QA Wizard Pro, choose Populate Repository to add the prototype Window or Page to the application repository.
  3. Write your test scripts first by using drag-and-drop from the Preview window.
  4. Make your user interface functional, frequently playing QA Wizard Pro scripts alongside your unit tests to verify functionality and development progress.
The combination of QA Wizard Pro's rapid-fire scripting and XAML's rapid UI prototyping enables fast test-driven development. Furthermore, by using QA Wizard Pro in your TDD process, you can be confident that you're functionally testing the production user interface, not a collection of mock objects.