iOS Automation Testing using UIAutomation framework

To guarantee the quality of your iOS application, you should follow the Test-Driven development  processes shown in below figure.

Create iOS test program using UIAutomation framework.

  1. Launch Instruments

Open XCode ->Open Developer Tool ->Instrument

In Instruments window, select Automation Instrument

To create a test script, you either record a Test Scenario or you program it manually.

  1. An instrument is launching, and Stop recording immediately. If you want to start the record, press Red button

Your First iOS test program using UIAutomation framework

  1. In the Scripts window, click Add > Create to create a new script
You're in the Trace window, use the Choose Target pull down to navigate to the debugging version of your App.

Your First iOS test program using UIAutomation framework

In this case, I will use Apple's sample SimpleDrillDown simple app as an application under test. It has GUI below.

Record your script by hitting the record button at the top or bottom of the tool.

Your First iOS test program using UIAutomation framework

Now you can do some UI action on your application under test, and your script is recorded.

  1. See your script

To see your script, hit the Trace Log/Editor Log drop down and switch to script log view.

Your First iOS test program using UIAutomation framework

You will see your recorded script.

Your First iOS test program using UIAutomation framework

Press play button, the script runs, and you can stop it after logs appear.

Your First iOS test program using UIAutomation framework

Create iOS test program using a OCUnit framework

  1. Start Xcode IDE, Add Unit Test Bundle target

Your First iOS test program using UIAutomation framework

  1. Write the name of the new Unit test Bundle as the figure above, then click Finish
  2. Make Unit Test active target

Your First iOS test program using UIAutomation framework

  1. Add a group for test classes

Your First iOS test program using UIAutomation framework

  1. Add a Unit test class
Apache Maven is a Java-based project management tool. It can provide a multitasking framework for...

Mobile Testing

iOS App Testing Tutorial: Manual & Automation

What is iOS App Testing? iOS App Testing is a testing process in which an iOS application is...

Mobile Testing

Appium Desired Capabilities for Android Emulator [Example]

This tutorial will help you to understand APPIUM automation tool. It will cover desired...

Mobile Testing

Calabash Automation Tool Tutorial for Android Testing

What is Calabash? Calabash is an open source Acceptance Testing framework that allows you to write...

Mobile Testing

Top 18 Appium Interview Questions & Answers

Download PDF 1) Explain what is Appium? Appium is a freely distributed open source mobile...

Mobile Testing

Android APP Testing Tutorial with Automation Framework

Why Android Testing? Android is the largest operating system in the world. At the same time,...