5

I'm trying to automate tests that test an app that has CA Layer objects. UI automation framework given by Apple does not identify CA Layer objects. I want a list of ui automation tools that help in identifying CA Layer objects. Can I get the list of tools please?

1 Answers1

4

UI Automation cannot access the CA Layer objects because they are not exposed to the accessibility mechanism in iOS. You can expose your layers to the accessibility API's by starting with an object that conforms to the UIAccessibilityContainer protocol. That object would provide a set of UIAccessibilityElement objects that would mirror the representation of your CA Layers. At that point, UI Automation would be able to "see" what the user sees when looking at the raw CA layers.

You get two benefits with this strategy. Your app is now accessible through things like Voice Over for the visually impaired, and you have a way to talk to your app through UI Automation.

This is what Apple recommends for apps that don't use the native UIKit functionality that does accessibility for you. IMHO, I think it's a good idea to follow this path because Apple's betting big on accessibility features and it's only going to go deeper with integration into the OS in the future.

Jonathan Penn
  • 1,341
  • 7
  • 8
  • Thanks for your reply. Right now my app's code is in C#. Im using MonoTouch to write my app. Is there a way to use UIAccessibilityContainer and UIaccessibilityElement from C#. – user1800035 Nov 18 '12 at 07:46
  • I tried getting the reference to UIAccessibilityContainer from MonoTouch, but could not get it. Please help me out with this. – user1800035 Nov 18 '12 at 08:41
  • Alas, I do not know anything about MonoTouch. I haven't use that mechanism. I'll have to bow out and let someone else speak to that. – Jonathan Penn Nov 22 '12 at 04:00
  • Some sample code here for implementing UIAccessibilityContainer with CALayer: http://stackoverflow.com/q/16428713/1804403 – Skotch May 07 '13 at 21:23