Sunday, 9 February 2014

First encounter with "UI Automation"

Was reading this book called "Test iOS Apps with UI Automation" by Jonathan Penn and I have my first trial of "UI Automation" inside Instrument today and it was quite interesting.


For those who never heard of "UI Automation", it's the trace template called "Automation" inside Instrument. It records your inter-actions with the simulator or the device, and then it creates a JavaScript file which you can later execute and it will simulate all the recorded UI interactions with your iOS application. The idea is, you can then sort of perform quite a lot of "boring" test steps to see if your latest modification caused any problem. Apple has a user guide here, and there's also an example here although it's a bit old.

However I found there's some limitations when using UI Automation with my latest game.

Although it did pick up "most" of the actions I performed on the device: such as tap on a button, swipe up or left, ...etc, occasionally it will miss a few swipe actions - and this makes it quite annoying. As my game relies heavily on user interaction, the execution of the test script failed quite frequently - as if user didn't swipe properly, the following action to tap on an button will certainly fail! I then have to track down which line failed, and manually add the swipe action.


Probably for iOS applications that has fixed buttons/tables would have a much higher success rate with UI Automation. Still recommend everyone to have a play with it, as it might save you lots of time with testing!

No comments:

Post a Comment