Until iOS7 we were happy using MonkeyTalk (2.0.8) for our automated UI tests. UIAlertViews
could be easily closed / confirmed via app.button("OK").tap
(JavaScript) or Button OK Tap
(MonkeyTalk Script).
This is not working on a device running iOS8. MonkeyTalk complains about not finding a button named "OK". Instead, you can tap the corresponding label. Finding a label named "OK" and tapping it works fine. At least optically. In iOS7 we've got a notification, that the current window resigned active, when the alert view has been closed. In iOS8 this notification is not sent any more, when the alert view is closed via app.label("OK").tap
, but IT IS sent, when the alert view is manually closed by tapping on the device.
Spark Inspector revealed that there is a _UIAlertControllerShimPresenterWindow
on top of everything ([UIApplication sharedApplication].keyWindow
) and it remains there, if the alert view is closed via MonkeyTalk. It even catches all user input and renders the app useless until restarted.
So, what is the correct / preferred way to close a UIAlertView
in iOS8 with MonkeyTalk?