I'm facing this weird problem in UIAutomation.
I am checking an alert. In that, I am trying to log alert title and alert message. My code for this is:
UIATarget.onAlert = function onAlert(alert) {
UIALogger.logMessage("alert Shown");
UIALogger.logMessage(frontApp.alert().name());
UIALogger.logMessage(frontApp.alert().staticTexts()[1].value());
}
var target = UIATarget.localTarget().frontMostApp().mainWindow();
target.scrollViews()[0].buttons()["saveB"].tap();
UIATarget.localTarget().delay(2);
I am not tapping on cancel button in the alert to dismiss it. But, it is getting tapped automatically. I don't know why. Even in the logMessages, I see
target.frontMostApp().alert().cancelButton().tap()
this line getting executed automatically. I don't have this line anywhere in my script file. Is it a bug in iOS?