I will also prevent the use of Image Recognition with SendKeys and Click at Coordinates or (Button Images) to test the user interface. I recently used UI Automation to successfully automate testing a WPF application. By placing small breadcrumbs (Automation.AutomationID = "OkButton") throughout our XAML application, I was able to write several C # tests that perform different aspects of the application. Even without breading, UI Automation can still run the application, but trying to identify controls in the user interface is a bit more complicated.
A decent article on Code Project is available as a starting point.
http://www.codeproject.com/KB/WPF/UIAutomation.aspx
You will also need UI Spy, a free tool from Microsoft to help you find controls and manually use controls through UI Automation as a guide for writing scripts. The tool is buried in the Windows Vista SDK after searching for an installation for UISpy.exe. The UI Spy tool can still work on a computer running Windows XP by simply copying the EXE to the target machine.
RodKnee
source share