I\'m trying to test the presence of an UIAlertView with UIAutomation but my handler never gets called.
At the beginning of my javascript i write :
UI
@vdaubry the solution is simple.
According to Apple documentation, if you want to handle alerts manually then you should return true
instead of false
in onAlert(alert)
UIATarget.onAlert = function onAlert(alert) {
UIALogger.logMessage("alertShown");
return true;
}
@Drew Crawford the delays will not work because by default can button is clicked by UI Automation. The documentation is not wrong but it is not clearly explained.