I am a beginner to UIAutomation. I wanted to know how do I tap one of the cells in a tableView thats inside an alert. As per Apple's UI automation documentation an alert will by default tap the cancel button if you dont specifically handle the alert and return true.
I tried the below written code (found at Apple developer). But this is still tapping the cancel button.
// second alert box "Nearby listings:"
UIATarget.onAlert = function onAlert(alert) {
var title = alert.name();
UIALogger.logWarning("Alert with title ’" + title + "’ encountered!");
if (title == "Nearby listings:") {
target.frontMostApp().alert().tableViews()["Empty list"].cells()[2].tap(); // tapping the second cell
return true; // bypass default handler
}
}
I would highly appreciate any kind of help.