Skip to main content

WinDriver Techniques Comparison

TechniqueAdvantagesDisadvantages
Control ClassFinding items is fast.
Positive actions on the items.
Scripts raise an exception if control does not exist.
Generally not location dependent.
* Can operate on non-visible items.
*May not work as expected on non-standard controls.
*Only works on controls with a window handle (e.g. not on status bar fields or WPF controls).
* Limited set of actions e.g. cannot get state of a checkbox.
AutomationControl ClassAs above except for speed of finding items.
Can operate on a greater range of UI items and item properties. Use the Microsoft SDK Inspect tool to identify the items.
Highly extensible by directly accessing the AutomationControl .AutomationElement. Many examples of UI Automation usage from Microsoft and other resources.
Control. ToAutomationControl allows easy conversion from Control objects.
Searching can be very slow when many UI items or deeply nested. The API limits the nesting of searched to a default of MaxSearchDepth (=3).
Coding using the Microsoft UI Automation methods can be quite difficult.
SendKeys for inputUsing keyboard actions, you can just about drive any UI.
Simple and very fast.
* Generally not location-dependent.
* Easy to type into the wrong control.
Bitmap MatchingWorks on anything displayed on the screen, including opaque apps such as Java, Flash remote terminals.
Eggplant Performance WinSpy can capture bitmap files.
Overhead can be high if searching in a large area or for large bitmaps.
Capture and replay must be identical color and resolution at pixel level. Even different graphics cards can alter images.
* Cannot read text.
Optical Character Recognition (OCR)Read text from items opaque to Control or AutomationControl classes.
Can turn tables into text arrays for easier data extraction.
3rd-party license is required per injector
Not always 100% accurate (although usually consistently wrong).
* CPU overhead can be high.