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

Building an iPad Test Suite with Reusable Pieces

We’ve seen how the element tree can vary on the iPad in different orientations. Now we want to apply that knowledge to our test scripts. How much can we reuse? What should we separate?

Because the interfaces are so different between the devices, it is best to make a separate test-suite file for the iPad. We can then pull in the screen objects one by one to figure out what can be reused. Here we’re going to write scripts to detect the device model and orientation and then use these to help the SearchTermScreen object find the elements it needs to do its job.

Finding the Device Model

The UIATarget instance provides the model method that returns a string describing what kind of system the app ...

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