Search code examples
iosinstrumentsios-ui-automation

UI Automation onAlert method not getting called for alerts


I'm writing a UI Automation test script and I have noticed that the onAlert function that is supposed to be called by the test script automatically every time there is a alert presented to the user is not getting called.

To test this I have a simple UIALogger.logMessage() call just logging a message that the onAlert method was entered.

Any ideas on why this is happening?


Solution

  • I found out that if execution of the test script reaches the end and an alert pops up, the onAlert handling function is no longer triggered even though the test session is still running and logging diagnostics.