Recording mobile tests for iOS applications

You can record a mobile test to capture the actions that you perform on iOS applications. The actions are captured as test steps to a mobile test recording.

Before you begin

You must have completed the following tasks:

About this task

After you install the Xcode and the command line tools for Xcode, you can connect the iOS device or simulator to your computer, you can then record the user interface and hardware actions in the iOS application that you want to test.

You can perform the actions that you want to record by using a virtual client of the mobile device. The actions that you perform are captured as test steps in the test recording. You can perform the following actions in the test steps of a mobile test recording:
  • Insert user actions.
  • Insert navigation actions.
  • Assign variables.
  • Insert verification points.
  • Substitute data by using custom code or datasets.
When you record actions on the iOS application, the controls on the application are identified by using one of the control properties which is a unique identifier for that control. The input fields on the iOS applications are identified by using the Label property also.
Note: If you recorded any user action on the container instead of the actual control due to an overlay of an element, you must manually modify the test step to use the actual control before playing back the test.
If the port number of the computer on which you run the UI Test Agent is not the default port, then you must specify the port number. To specify the port number, you must perform the following tasks:
  1. Click Windows > Preferences > Test Execution > UI Test Playback > Mobile Device tab.
  2. Select theHost check box.
  3. Enter the port number in the Port field.

You can then perform the following steps to record a mobile test on the iOS application.

Procedure

  1. Go to the UI Test perspective in Test UI.
  2. Click the New Test from Recording icon in the toolbar and select Mobile Test.

    The New Mobile Test From Recording dialog is displayed.

  3. Select a directory to save the test.
  4. Enter the name of the test in the Test name field, and click Next.
    The Select mobile application page displays the list of all mobile applications that you configured in the Application Configuration page.
  5. Select the iOS application that you want to test.
    Note: The real devices or the simulators that are connected to the computer are listed and you can select any device or simulator from the list.
  6. Select the device from the Select mobile device list.
  7. Click Next, and then click Finish.

    The application is displayed in a virtual client of both, the real mobile device or the emulator.

    The recording is started in a web browser.

    You can perform the actions on the selected mobile application by using the virtual client. The actions that you perform are imitated on the device or emulator and are captured as test steps in the test.

    The test steps are displayed on the Test Steps pane of the virtual client window.

    The following table lists the options of the actions that you can perform in the virtual client:
    Option Action when clicked
    Stop recording stop mobile recording Stops the recording and generates the mobile test recording
    Screen lock Performs screen lock action Performs the lock screen action on the mobile device or simulator
    Refresh refreshes the virtual client Refreshes the virtual client if the actions that you perform on the virtual client is not synchronized with the mobile device
    Volume up increase volume level Increases the volume on the mobile device or simulator
    Volume down Reduces the volume in the device or emulator Decreases the volume on the mobile device or simulator
    Home Navigates to the home screen Navigates to the home screen
  8. Click Stop recording.
    The recording of the test is stopped and the browser window is closed. The Test Generation dialog is displayed in the UI Test perspective.

Results

You have recorded a test for an iOS mobile application.

What to do next

You can perform any of the following tasks: