UIAutomation – more help please 16 August 2010
Posted by David Wilson in iPhone.trackback
Not my usual post here.
I have been corresponding with Michael in Denmark over getting more cameras for that region loaded into TrafficCamNZ and also trying to resolve an issue that can cause the application to crash. The crash issue was rather difficult for me to reproduce. The good news is that I managed to get there in the end, find and fix the issue. I’ll make the submission to Apple for the new version shortly. In the mean time I watched WWDC 2010 Session 306 – Automating User Interface Testing With Instruments. This was quite inspirational and I though that I should be doing some of this automated testing.
Using the video from the WWDC session and slides was enough to get me started. It also had pointers to documentation. I quickly ran into issues trying to detect objects on the iPhone screen and was unable to determine when I should use .elements() and other things like .buttons(). And then some calls returned arrays of information making it difficult to get what I wanted. During the last few days I made several posts to the developer forums at Apple with requests for information and updates on my progress. I haven’t received much feedback but it is the US holiday season and this development work did occur over a weekend.
To help out other fellow developers I thought you would appreciate a post of some references and a copy of my script, which for the moment works with one exception. The exception is where I’m trying to detect the name of an onscreen alert. if you need this, you’ll see it in my code. And when it comes times to you needing it, I’ll either know what I’ve done wrong, or if it’s a but it will be fixed!
Enjoy, and please share your experiences.
Apple Documentation
http://developer.apple.com/iphone/library/documentation/DeveloperTools/Reference/UIAutomationRef/Introduction/Introduction.html
http://developer.apple.com/iphone/library/documentation/ToolsLanguages/Reference/UIATargetClassReference/UIATargetClass/UIATargetClass.html
http://developer.apple.com/iphone/library/documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html
Other Web Articles
http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/
http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/
JavaScript


Hi David – I’m getting desperate after purchasing 2 missile launchers from ‘Satzuma’ for friends/family Xmas presents and who only have imacs! I downloaded your software (several times) but been unable to unlock the unit. It looks the same as the image in your software and seems to be a ‘Nipco’ model?
All obvious checks have been made.
There is no obvious vendor nor product id.
Can you please help?
Mark
Hi there!
Is it the grey one with white foam darts?
With the launcher plugged in, I need you to run the terminal program (it’s in the utilities folder) and key the following
ioreg -l -w 0 > ~/Desktop/Missilelauncher.txt
Find the file called Missilelauncher.txt on your desktop and e-mail it to me.
That will at least let me know details about the launcher etc and I can tell you if it will work with this software (I hope).
Also, this launcher (my ones at least) take 4 x aa batteries. And the launcher has an on/off switch on the bottom Can you check that too please).
- David
David G. Wilson http://dgwilson.wordpress.com http://homepages.paradise.net.nz/dgwilson/