Re: API for automated GUI testing
Re: API for automated GUI testing
- Subject: Re: API for automated GUI testing
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 18 Jun 2006 14:57:54 -0400
- Thread-topic: API for automated GUI testing
on 2006-06-18 1:11 PM, Rob Nikander at email@hidden wrote:
> I want to write an automated testing framework that works at the user-
> interface level -- point, click, type, etc. So I'm looking for an
> API that allows me to control and record the GUI events, even if they
> are going to other applications, and to get screen pixel data. Can
> anyone point me in the right direction?
The accessibility API will enable you to do this.
The "assistive" part of the accessibility API is what you're going to use to
write your automated testing utility. It will be an "assistive" application
in the same sense that, say, VoiceOver is an assistive application. It will
use the built-in accessibility of a target application's user interface
elements by reading and controlling the target application's widgets, typing
into its text fields, and registering to receive notification of changes
from it.
All applications built with standard Carbon and Cocoa user interface widget
code are accessible, because accessibility has been built into the system
since Mac OS X 10.2 Jaguar. Applications with custom widgets can also be
accessible if their developers bothered to make them so. Some longtime
popular Mac applications still aren't fully accessible, however, because
they still contain a lot of legacy code.
Look for this documentation, installed with Xcode Tools, for help writing an
"assistive" application:
- Accessibility Reference for Assistive Applications Release Notes
- UI Element Inspector sample code (a Cocoa application)
This documentation is also useful, although it is focused on making a target
application accessible:
- Getting Started with Accessibility
- Accessibility Overview
- Accessibility Programming Guidelines for Cocoa
- Accessibility Programming Guidelines for Carbon
- Accessibility Reference
Some of what you're planning to do already exists, though not automated, in
Apple's free Accessibility Inspector application and my more powerful
utility, PreFab UI Browser (download a free 30-day trial version at
www.prefab.com/uibrowser/). It's worth playing with both of these to get a
feel for what the accessibility API can do for you.
A shortcut for doing automated testing is to use GUI Scripting, a subspecies
of AppleScript. Check out this site for information:
www.apple.com/applescript/uiscripting/.
I've written a Cocoa framework for the accessibility API, which might give
you a big head start. It has been the engine inside PreFab UI Browser for
about three years now. It is constantly updated. Contact me offlist for more
information.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden