views:

298

answers:

3

Are there any tools out there which uses Image Recognition(searching, comparing, validating images) as base for automating and testing GUI software.I know ranorex supports it. Are there any better tools?Are there any gotchas in using Image Recognition to drive test automation?

A: 

thanks for your comment! please Take a look at RoutineBot – interface testing software based clicking on certain image patterns and see for yourself how this idea is implemented in an automation tool!

sk
From RoutineBot's own FAQ: "If you use in your script image patters, and the original appearance of some, say button, in tested application changed, then script will not be executed correctly. So, when designing you scripts have in mind this possibility. There are some possible solutions to this problem: you can use ClickButton command, which uses button’s caption text (not its image). Another solution is using smaller image patters, in this case there are less chances for the pattern to be changed."-- Like I said, image recognition ought to be considered as a last resort.
Tom E
+1  A: 

I would also discourage using Image Recognition with SendKeys and Click at Coordinates or (Button Images) to do UI testing. I have been recently using UI Automation to automate the testing of a WPF application with success. By placing small breadcrumbs (Automation.AutomationID="OkButton") throughout our application's XAML I have been able to write some C# Unit Tests that exercise different aspects of the application. Even without the breadcrumbs UI Automation is still capable of exercising an application, but it is slightly more difficult when trying to identify the controls on the UI.

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, which helps you find controls and manually exercise the controls through UI Automation as guidance for writing the scripts. The tool is buried in the Windows Vista SDK, after installation search for UISpy.exe. The UI Spy tool can still run on a Windows XP machine by just copying the EXE to the target machine.

RodKnee
A: 

I agree with RodKnee and Tom E. Using image recognition for UI testing is nothing short of extremely painful and a waste of time. If your application is correctly built you can push the UI logic into a different layer of your application that is more easily tested.

The MVP pattern was created for this very purpose. Each operation that can be accomplished via the UI is represented somewhere in the View. In this way, you can strip out the UI completely and still unit test your application using the remaining architecture (M-V-C).

The thought of image recognition to accomplish this kind of thing makes me shudder.

Doug