Previous Topic: Mobile Testing TutorialsNext Topic: Tutorial 2 - Record an Android Test Case


Tutorial 1 - Record an iOS Test Case

This tutorial illustrates each of the steps that are required to record a test case using an iOS simulator.

In this tutorial, you perform the following tasks:

 

Step 1 - Start DevTest Workstation

Follow these steps:

  1. Start the registry.
  2. Click Start, All Programs, DevTest Solutions, DevTest Workstation.

    The Set DevTest Registry dialog opens.

  3. Select a registry and click OK.

Step 2 - Create a Project

The project that you create holds all the test case example files that are required for the mobile tutorials.

Note: If you created the MyMobileTutorials project in a previous tutorial, skip to Step 3, Create a Config File for an Android Simulator.

Follow these steps:

  1. From the DevTest Workstation main menu, select File, New, Project.

    The Create New Project dialog appears.

  2. In the Project Name field, type MyMobileTutorials.
  3. Accept the default setting to create the project in the LISA_HOME directory.
  4. Click Create.

    The MyMobileTutorials project is created.

Step 3 - Create a Config File for an iOS Simulator

The default configuration is named project.config, and is created automatically for a new project. The project.config file is located in the Configs folder in the Project panel. You can create a configuration file that contains asset information specific to using an iOS simulator.

Follow these steps:

  1. Right-click the Configs folder in the Project panel and select Create New Config.
  2. Enter the name of the new configuration: MobileiOSSimulator.
  3. Click OK.

    The MobileiOSSimulator config file opens in the properties editor.

  4. Right-click the MobileiOSSimulator config file in the Project panel and select Make Active.

 

Step 4 - Create an iOS Simulator Asset

A Simulator Session asset that is associated with a specific config lets you specify the mobile simulator that is used for testing.

Follow these steps:

  1. Open the MobileiOSSimulator configuration file that you created in Step 3 - Create a Config File for an iOS Simulator (if it is not already open).
  2. In the Asset Browser, click Add Icon to add an asset at the bottom of the pane.
  3. Click Mobile Session.

    The Mobile Session dialog displays.

    Note: If you have already defined values for any of these fields, you can select the value from the list for that field. To add or remove values from the list, select Maintain List.

  4. Enter the following fields:
    Name

    Enter iOSSimulator.

    Description

    Enter iOS Simulator for use with Mobile Tutorial 1.

    Platform

    Select iOS from the drop-down menu.

    Application

    Navigate to and select the UICatalog.app file that you downloaded.

    Family

    Select iPhone only from the drop-down menu.

    Target

    Select Simulator from the drop-down menu.

    Simulator

    Navigate to and select the iOS simulator on your machine.

    iOS Version

    Select 6.1.

  5. (Optional) To verify the asset before saving, click Arrow icon to verify the validity of an asset..
  6. Click OK.

    The new iOS Simulator asset appears in the Asset Browser.

  7. Click Save.

Step 5 - Record a Test Case

Follow these steps:

  1. Ensure the MobileiOSSimulator config file is active.
  2. Create a test case named Tutorial_iOS_Simulator:
    1. Right-click the Tests folder in the Project panel and click Create New Test Case.
    2. In the dialog, browse to the directory where you plan to store the test case.
    3. Enter the name of the new test case.
    4. Click Save.
    5. Click Create steps by recording or templating Image of VSE Recorder icon (yellow lightning bolt).
  3. Click Record Test Case for User Interface, Mobile Recorder.

    The mobile test recorder and the mobile simulator windows open.

  4. If you defined multiple mobile assets, select an asset to connect to using the Choose Mobile asset drop-down list, then click OK.
  5. Click Start Recording at the bottom of the recorder window.

    You are now recording.

  6. Perform the actions that you want to record for your test case in the recorder window.

    Note: Do not perform these actions in the mobile simulator directly. All actions that are performed in the recorder window are sent to the simulator automatically.

  7. Click Stop Recording when you have captured all of the actions for your test.

    The recorder window and the mobile simulator close. Your new test case is populated with test steps that represent the mobile actions that are captured during the recording. Each test step represents the actions that you performed on a specific screen in the application.

  8. To view the details of each step:
    1. Click the test step to review.
    2. Click Mobile testing step in the element tree on the right to expand the details for the step.

      The Mobile Testing Step tab opens and shows a screenshot of the test application. The Actions section at the top of the tab shows the individual actions that are performed in the test step.

    3. To view the screenshot associated with a specific action, click the action in the Actions section.

      For more information about modifying a recorded test step, see Modify Mobile Test Steps.

      For more information about adding assertions to your test step, see Add an Assertion to a Mobile Test Step.

Step 6 - Run the Test Case in the ITR

Follow these steps:

  1. Open the test case from Step 5 - Record a Test Case (if it is not already open).
  2. Click the ITR icon Blue Gear Icon on the toolbar.

    Note: Select whether to start a new ITR run or open a previous ITR run (if you have run the ITR before).

    The Interactive Test Run window opens.

  3. Click Execute LISA--icon_image_rightarrowingreencircle at the bottom of the ITR window.

    The mobile simulator window opens and DevTest runs the test steps. The mobile application is visible on the simulator while the test is running.

    When the test is complete, a message opens indicating the test is complete. The simulator window closes.

  4. Click OK.

    For more information about using the ITR, see Running Test Cases and Suites.