Usability of UIAutomation for Automated Testing

Originator:lewis
Number:rdar://9776042 Date Originated:14-Jul-2011 11:08 AM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
This is a feature request to make it so one can automate UIAutomation in a continuous integration setup.

The first and foremost thing is the ability to run UIAutomation scripts and check for success automatically.  I realize this is possible with 5.0 SDK beta 2 with the instruments command line, however this isn't very useful.  One needs to save a different template per config, per script needing to be run which means explosion of templates.  It is also very hard to version control said templates and have them run on systems where the templates weren't defined.

For this, we would need a command-line utility just for UIAutomation.  (Running UIAutomation programmatically on the device is less of a concern to me).

A usable command line utility would have the following features:

- Ability to select Script to run.
- Ability to choose target
- Ability to choose device in simulator and SDK version
- A valid exit code (whether or not the test succeeded)
- Controlling timeouts from the command-line
- Ability to reset the simulator to a clean (or already set up) state for each run

Nice to haves:
- Ability to control multiple applications to see how they interact with each other (for example, using the URL API)
- Ability to run multiple instances of the simulator at once (to run tests in parallel)
- Ability to run simulator headlessly (and still take screen shots).  This would be great for CI environments.
- Ability to change location of the simulator via the UIAutomation scripting or the command line
- Ability to reference environment variables in UIAutomation scripts.

I did find it's possible to run multiple instances of springboard if one runs login and starts a new session.  I imagine that the MIG port that's used is bound to the login session.  I haven't tried something like chroot jails to run the simulator in parallel.


Overall I think these features would take UIAutomation from something that's pretty cool technology, yet pretty useless for testing and make it a world-class integration testing framework.

Comments

UIAutomation is being deprecated in favor of UI Testing, introduced in Xcode 7, sadly. Others have attempted third-party test runners similar to what you're describing: https://eng.uber.com/rescued-by-octopus/

By richard.yeh at Feb. 11, 2016, 11:57 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!