I am trying to use UIAutomation in Instruments with the iPhone Simulator and the latest iOS SDK 4.2. in my app that has 2 unlabeled toolbar, i have just only access to the head-toolbar like :
var window = UIATarget.localTarget().frontMostApp().mainWindow();
window.toolbar().buttons()["upload"].isVisible();
and can not use isVisible() for the buttons (cancel,ok,forward) in the remain unlabeled toolbar (enclosed my logs below)
4) UIAToolbar [name:(null) value:(null) NSRect: {{0, 20}, {320, 44}}] 5) UIAButton [name:angle_bracket_left_i value:(null) NSRect: {{-3, 16}, {50, 51}}] 5) UIAButton [name:angle_bracket_right_ value:(null) NSRect: {{27, 16}, {50, 51}}] 5) UIATextField [name:(null) value:http://www.google.com.vn/ NSRect: {{72, 29}, {164, 26}}] 5) UIAButton [name:upload value:(null) NSRect: {{246, 29}, {34, 27}}] 5) UIAButton [name:Refresh value:(null) NSRect: {{285, 24}, {28, 33}}] 4) UIAToolbar [name:(null) value:(null) NSRect: {{0, 436}, {320, 44}}] 5) UIAButton [name:cancel value:(null) NSRect: {{1, 439}, {50, 40}}] 5) UIAButton [name:ok value:(null) NSRect: {{132, 430}, {50, 51}}] 5) UIAButton [name:forward value:(null) NSRect: {{263, 430}, {50, 51}}]