Advanced Alert-Handling

When we refresh the map over the ocean, an alert pops up letting the user know that nothing was found. To test for this behavior, we’re going to dig deeper into handling alerts. We’ll look into the differences between asynchronous and synchronous alert-handling and choose the technique that works best for us in these cases.

Asynchronous Handlers

We first worked with alerts in Testing with a Modal Alert View, where we set up a simple handler to return true so the system knew we wanted the alert to remain on the screen while we interacted with it. That gave us the power to synchronously interact with alerts. This time let’s try asynchronous handling to see if it offers us a clearer way to express the test.

In our ...

Get Test iOS Apps with UI Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.