Simple Automation project using Python atomac on Mac OS X

The Product Automation in MAC OS X is quite easy if we have enough knowledge in the following languages and tools

Full Project download at below link:
https://github.com/vijayanandrp/Mac-OSX-App-UI-Automation-Testing
  1.  Bash Scripts
  2.  Apple Scripts
  3.  Python especially ATOMac
  4. Knowledge in Accessibility.
For more understanding of the LDTP:
LDTP - Tutorial is written by  Nagappan Alagappan. He has given the clear idea and architecture of the LDTP and its working.

I have used the contents from the tutorial for knowledge sharing. Following are the few information and contents from  the LDTP - Tutorial.

Few interesting key points,
    • Linux Desktop Testing Project (LDTP) is aimed at producing high quality test automation framework and cutting-edge tools that can be used to test GNU/Linux Desktop and improve it. 
    • It uses the Accessibility libraries to poke through the application's user interface. 
    • This idea has been extended to Microsoft Windows as Cobra, Mac OS X as ATOMac
    • LDTP is now known to work on Windows / Mac /Linux / Palm Source / Solaris / NetBSD / FreeBSD.
    • LDTP can test any .NET / GNOME / KDE (QT >= 4.8) application which are accessibility enabled, Mozilla, Open Office/Libre Office, any Java application (should have a UI based on swing

    Cross Platform GUI Test Automation tool
     Linux version is LDTP, Windows version is Cobra and Mac version is PyATOM + ATOMac.


    About testing

    Why testing ?

    Testing is a process to identify defects in a (software) system. For more information - 




    Why automation ?

    Testing an application multiple times with same steps, automated process can do a better job.

    Complexity of GUI testing ?
    • Identification of object in a window (push button, menu item)
    • Should be context sensitive (Window specific operation)
    • Handling of unexpected pop-up windows
    • Keeping the test script in sync with the UI changes
    • Failures has to be verified on each operation
    • Rendering of images / text in the display area
    What type of testing can be done using LDTP ?
    LDTP can be used to test the functionality of any accessibility enabled application.

    Advantage of accessibility based testing
    • Accessibility libraries provide applications property, state, its child items etc.
    • No need to work in toolkit (GTK, AWT, QT) level

    LDTP Features
    • LDTP concepts are derived from Software Automation Framework Support
    • LDTP supports verification of actions performed (guiexist, verifystate, etc) - API Reference
    • Writing test scripts are very easy, the script writer need not know about the object hierarchy
    • CPU / Memory performance monitoring of application-under-test can be measured - Class pstats
    LDTP

    ##################             AUTOMATION IN MAC                 #######################

    Now its time to learn the automation in MAC OS X. Before that make sure you the following app and setup to test your

    Prerequisite
    1. Install Xcode with UNIX development option
    2. sudo easy_install atomac [or] sudo pip atomac
    sudo easy_install atomac [or] sudo pip atomac

         3. Install Pycharm IDE for running python 


    Enabling Accessibility feature and adding the app in it. 

    To reach Accessibility, 
    choose
     System Preferences --> Security & Privacy --> Accessibility



    We should add Terminal.app or PyCharm CE.app to Accessibility to get UI controls in the Mac Product. 

    We can add app directly by dragging the app to Accessibility 
                              or
     by adding the entries directly to the TCC.db where Accessibility permissions for the app will be stored locally in machine.

    sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/usr/sbin/jamfAgent',1,1,1,NULL)"

    For more learnings regarding accessibility,  Jacob Salmela has written a good python tool to interact with TCC.db
    +


    Full Project download at below link:
    https://github.com/vijayanandrp/Mac-OSX-App-UI-Automation-Testing

    Comments