Take the 2-minute tour ×

I'm in the process of automate one of my apps.

First I tap on a tabBar =>ok

Tap on a 'Add' button of a navigation bar => ok

Fill some data of my textFields of my tableView => ok

Tap on some cell and open a new ViewController => ok

Tap on a 'Add' button in this new controller => nothing happens ...

The button is the same as the first view: UIBarButtonSystemItemAdd

So, now I want to show all the buttons that automation can find, and iterate and get their names, just to check that all is going well, but I can't find the name of the buttons, see:

var arr = UIATarget.localTarget().frontMostApp().navigationBar().buttons();
  var value = arr[i];

And I'm tapping both buttons the same way:

UIATarget.localTarget().frontMostApp() .navigationBar().buttons()["Add"].tap();




Ok, the button tap has been solved using a delay of 1

But I can't get the button names in the loop, but at least I can continue auomating my app

share|improve this question

1 Answer 1

up vote 0 down vote accepted

To see what elements your screen has at a certain moment, put


in your script. It will show all elements with their accessibility properties (name and value) in your app's current state.

If your buttons has not names, you have to set accessibility properties in your XCode project for these buttons, see there.

share|improve this answer
thanks for your time to answer an old post :-) –  mongeta May 7 '11 at 15:05
spent a week with instruments, got some insight and found many unanswered questions on SO :) –  jki May 7 '11 at 16:29

Your Answer


