views:

29

answers:

0

Hi,

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();
for(var i=0; i<arr.length; i++) {
  var value = arr[i];
  UIALogger.logMessage(value.name);
}

And I'm tapping both buttons the same way:

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

thanks,

r.

EDIT:

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