Hi,

I’m trying to make some test with UIAutomation, basically, I select an image 
from the camera roll, UIImagePickerController allowsEditing property is set to 
YES. When I try to tap the “Choose” button I got this error:

        Script threw an uncaught JavaScript error: 
target.frontMostApp().windows()[0].buttons()[2] could not be tapped…

Looking at the view hierarchy of UIImagePickerController here’s what I got:

        target.frontMostApp().windows()[0].logElementTree();

        UIAWindow: rect:{{0, 0}, {320, 568}}
                UIANavigationBar: name:Moments rect:{{-320, 0}, {320, 44}}
                UIACollectionView: value:page 1 of 1 rect:{{-96, 0}, {320, 568}}
                UIAImage: name:UINavigationVerticalColumnShadow.png rect:{{-9, 
0}, {9, 568}}
                UIAScrollView: rect:{{0, 0}, {320, 568}}
                UIAButton: name:Cancel rect:{{13, 514}, {56, 34}}
                UIAButton: rect:{{145, 515}, {30, 34}}
                UIAButton: name:Choose rect:{{244, 514}, {63, 34}}

So I access the “Choose” button this way: 
target.frontMostApp().windows()[0].buttons()[2] and log the view hierarchy:

        target.frontMostApp().windows()[0].buttons()[2].logElementTree();

        UIAButton: name:Choose rect:{{244, 514}, {63, 34}}

So, definitely is not nil, but when I tap it, I got the error above.

        Script threw an uncaught JavaScript error: 
target.frontMostApp().windows()[0].buttons()[2] could not be tapped…

Somebody can help me?, UIAutomation is so obscure.

Thank you.

--
Juan Felipe Alvarez Saldarriaga
http://juan.im
Twitter: @nebiros
Google Talk: nebi...@gmail.com
Skype: jfasaldarriaga

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to