O'Reilly logo

Test iOS Apps with UI Automation by Jonathan Penn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required