Getting started with testing on the iOS Simulator

Use this topic to help you get started with your testing of native, hybrid, and Web applications on the iOS Simulator.

Before you begin

Note the following requirements:

Note: Xcode is the Apple integrated development environment (IDE) used for developing Macintosh and iOS applications. You can download Apple Xcode from the Xcode Dowloads and Resources web site or from the Apple App Store on a Macintosh computer.

About this task

The following diagram shows a high-level overview of mobile testing for iOS applications using the iOS Simulator:

iOS Simulator flow diagram ../../com.ibm.rational.rtw.install.doc/topics/c_rtw_overview.html ../../com.ibm.rational.test.lt.moeb.doc/topics/t_test_ios_native_device.html ../../com.ibm.rational.test.lt.moeb.doc/topics/trecord_ios_app.html ../../com.ibm.rational.test.lt.moeb.doc/topics/cmobtesteditovw.html ../../com.ibm.rational.test.lt.moeb.doc/topics/tintro_run_test.html ../../com.ibm.rational.test.lt.moeb.doc/topics/t_evaluate_results.html

Procedure

  1. Install IBM® Rational® Test Workbench on a Macintosh, Windows or Linux computer and ensure that Extension for Mobile is selected. For details, see Installing the product software.
  2. From the test workbench, create a test project by clicking File > New > Test Workbench Project.
  3. If you need to build and instrument a native or hybrid iOS app for testing, proceed as follows:
    1. Download the build archive on to a Macintosh computer.
    2. Run rtwBuildXcode.sh to instrument the AUT and send it to the test workbench.

    For details, see Instrumenting iOS applications.

  4. If you are testing mobile Web applications, be sure to install the IBM Rational Test Workbench Mobile Web Recorder on the iOS Simulator.

    The mobile web recorder is required to record and play back user actions of a Web application under test. It is invoked automatically during the recording and playback process. For details see Installing the IBM Rational Test Workbench Mobile Web Recorder on the iOS Simulator.

  5. In the test workbench add the application under test as a managed, instrumented application. For details, see Importing applications to test in the workbench.
  6. Open the browser-based client by typing the Workbench URL in the following format in the Safari browser on the iOS Simulator:

    Format: http://Workbench_URL:port/mobile

    Example: http://192.0.2.24:7878/mobile

  7. Create a test by recording gestures and interactions. Actions are represented in natural language, which allows you to document and reproduce the test manually.
  8. Examine and enhance the test script recording as needed. Here are some of the things you can do:
    • Add verification points to verify that an expected value or behavior is returned during a test run.
    • Add variables to the test script.
    • Add a loop so that the test runs multiple times
    • Add a datapool to provide variable data rather than the data that you recorded
    • Add application stubs to simulate the behavior of actual objects that interact with the application under test.
  9. Run the test in the iOS Simulator.

    You can start a test run from the iOS Simulator or from the test workbench.

  10. Evaluate the test results.

What to do next

For additional guidance, see the Testing mobile applications with Rational Test Workbench playlist on YouTube.

Feedback