Previous Topic: Tutorial 1 - Record an iOS Test CaseNext Topic: CA Service Virtualization Tutorial


Tutorial 2 - Record an Android Test Case

This tutorial illustrates each of the steps that are required to record a test case using an Android 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 Android 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: MobileAndroidSimulator.
  3. Click OK.

    The MobileAndroidSimulator config file opens in the properties editor.

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

 

Step 4 - Create an Android Emulator 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 MobileAndroidSimulator configuration file that you created in Step 3 - Create a Config File for an Android 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.

  4. Define the following fields:
    Name

    Enter AndroidSimulator.

    Description

    Enter Android Simulator for use with Mobile Tutorial 2.

    Platform

    Select Android from the drop-down menu.

    Application

    Navigate to and select the ApiDemos.apk file that you downloaded.

    Target

    Select Emulator from the drop-down menu.

    AVD

    Enter the name of the Android AVD that you defined when configuring mobile testing.

    SDK Version

    Select 4.2.2.

  5. Click Arrow icon to verify the validity of an asset. to verify the asset.
  6. Click OK.

    The new Android Simulator asset appears in the Asset Browser.

  7. Click Save.

Step 5 - Record a Test Case

Follow these steps:

  1. Ensure the MobileAndroidSimulator config file is active.
  2. Create a test case named Tutorial_Android_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.
  3. Click Create steps by recording or templating Image of VSE Recorder icon (yellow lightning bolt).
  4. Click Record Test Case for User Interface, Mobile Recorder.

    The mobile test recorder and the mobile simulator windows open.

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

    You are now recording.

  7. 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.

  8. 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.

  9. 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.