Note that * and ? can be used as wildcard match characters in all ATOMac search methods: > close = sheet.buttons('Close')ĪTOMac has a method to search for UI Elements that match any number of criteria. These search methods can be given terms to identify specific elements. The recursive search finds items that aren’t just direct children, but children of children. Each search method, such as windows, has a corresponding recursive search function, such as windowsR. There are search methods for most types of accessibility objects. There is a shortcut for getting the sheet object which bypasses accessing it through the Window object - ATOMac can search all objects in the hierarchy: > sheet = automator.sheetsR() Using Xcode’s included accessibility inspector can provide a quick way to find these attributes. ATOMac supports reading and writing of most attributes. Note that we retrieved an accessibility attribute from the Window object - AXTitle. Now, we can find objects in the accessibility hierarchy: > window = automator.windows() Next, get a reference to the UI Element for the application itself: > automator = atomac.getAppRefByBundleId('') Once the atomac module is installed, you should be able to use it to launch an application: > import atomac Installation should be as simple as running the following command line, which will download, build and install ATOMac: $ sudo easy_install atomac Usage Failure to enable this will result in ErrorAPIDisabled exceptions during some module usage. Check the checkbox: System Preferences > Universal Access > Enable access for assistive devices. Systemwide accessibility must be enabled. If you experience issues with ATOMac on a particular version of OS X, please open a ticket in the issue tracker. It has been tested extensively on 10.6, 10.7, and 10.8. Getting startedĪTOMac requires a system running OS X and Xcode installed. It’s fast and easy to use to write tests. Existing tools such as using appscript to send messages to accessibility objects are painful to write and slow to use. This library was created out of desperation. We are pleased to introduce the first Python library to fully enable GUI testing of Mac applications via the Apple Accessibility API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |