There are several techniques you can use to test the user interface of a Windows application such as the System.Reflection classes or Win32 API functions such as FindWindow. But the development of the UI Automation library may be one of the most important advances in test automation to date. Compared with alternative approaches to UI automation, the UI Automation library is more powerful, often easier to use, and more consistent.
In the February issue of MSDN Magazine, in our Test Run column, Dr. James McCaffrey will show you how to get started with UI test automation using the new Microsoft UI Automation library. You can use the UI Automation library to test Win32 applications, .NET Windows Forms applications, and WPF applications on host machines running operating systems that support the .NET Framework 3.0.
James also examines some ways you can extend the ideas in his introductory test automation harness. One obvious extension is to parameterize the harness. You could create a test case data store as a text file, database table, or XML file and iterate through each test case, parsing out test case data and passing the data into the test harness, a design pattern discussed in his August 2005 Test Run column.
Don’t forget to browse the sample code in our online code library.