Testing MobileFirst Platform applications with the Mobile Test Workbench

improve this page | report issue

Overview

IBM Mobile Test Workbench v7.8.0.1 for IBM MobileFirst Platform Foundation provides several unique resources to test MobileFirst applications.

  • You can create functional tests on hybrid and native applications that run on iOS 7.x or Android.
  • The test workbench creates tests in a natural language and provides visual test editing.
  • The test workbench runs within Eclipse and is integrated with MobileFirst Studio.

The testing approach with the test workbench consists of four stages:

  1. Recording: You first play your test with the recording-ready app and generate a test script.
  2. Authoring: You edit and enhance the test script by adding verification points and others instructions.
  3. Playback: You run the test script on a real device or on a simulator.
  4. Reporting: You generate an HTML report.

This tutorial covers the following topics:

Installing and configuring the test workbench

To use the IBM Mobile Test Workbench, you must install an Eclipse plug-in into an existing instance of MobileFirst Studio.

In MobileFirst Studio, go to Help > Eclipse Marketplace and search for "mobilefirst".
When you locate the IBM Mobile Test Workbench, click Install.

Note: New installations of IBM Mobile Test Workbench require the latest version of MobileFirst Studio.

After the Mobile Test Workbench plug-in is installed, you can see that a new Test Workbench perspective is available in Eclipse:

missing_alt

If you do not see the perspective button above, select Window > Open Perspective > Other... and then Test Workbench.

Also, note the following icons in the Eclipse toolbar:

missing_alt

  • The leftmost icon opens the Mobile Applications view. This view lists all the applications that are available for testing.
  • The next icon opens the Mobile Devices view. This view lists the devices that you use to test your application.

The mobile client

With the mobile client application, you can record tests, run test playbacks, and view reports on the mobile device.
The mobile client application must be installed on a real device or on a simulator/emulator.

The mobile client communicates with the test workbench to install applications, store test scripts, and test results. Important: Note the Workbench URL in the Mobile Devices view:

missing_alt

Installing the Android mobile client

To install the mobile client on an Android device or on an emulator:

  1. Use the QR code that is available in the Mobile Devices view to open an installation page on the device.
    On the device, the QR code opens a page that displays installation instructions.
  2. missing_alt

  3. Follow the instructions to download and install the mobile application on your Android device.
    missing_alt
  4. When the IBM Rational Test Workbench application is installed on your device, start the application.
  5. Configure the address of the test workbench in the Workbench settings section.
    The URL is the same as the URL of the page opened by the QR code, without /mobile at the end. The URL has the following structure: http://host-ipaddress:7878

    missing_alt

  6. Press the device Back button. If the connection is correctly established, you can see the connection icon at the bottom of the screen.

    missing_alt

Installing the iOS mobile client

missing_alt
On iOS, the mobile client is a web application that runs in the Safari or Chrome browser on your device.

To run the client, type the Workbench URL in the following format, in a browser on your device: http://Workbench_URL:port/mobile

When using the mobile test client on an iOS device, make sure to enable pop-up windows. Pop-up windows must be allowed for the
Workbench IP address. Safari silently disables pop-up windows and Google Chrome prompts you to allow pop-up windows. To change this setting for Safari, navigate to Settings.app > Safari and disable the option to Block Pop-ups.

Creating a test project

To start testing an IBM MobileFirst application, you must create a test project.

You create a test project in one of two ways:

  • After creating the MobileFirst application, and before clicking on Finish, select IBM Mobile Test Workbench:

    missing_alt

  • You can also select File > New > Test Workbench Project.

    missing_alt

Preparing an application for testing

Before you can test an MobileFirst hybrid application, go through the following steps:

  1. Build and deploy your project by right-clicking the project name and selecting Run As > Run on MobileFirst Development Server, to ensure that the native project is built and the application is deployed to the server.
  2. If you build for iOS to test on a physical device, make sure that the appropriate certificate is specified in Xcode.
  3. Right-click the Android, iPhone, or iPad environment in your MobileFirst application and click Run As > Test with IBM Mobile Test Workbench.

    missing_alt

    You can now see the test-ready application in the Mobile Applications view in the test workbench and in the mobile client.

    missing_alt

  4. Set the state of the application to Available in the Mobile Applications view before you start recording a test.

Creating a test

  1. Start recording a test.
    • On the Android client, select the application in the list of managed apps and click Record in the mobile client on the device.
    • On the iOS web client, select the application in the list of managed apps, install the app on the device by clicking Install. When the installation is complete, click Record.

      If you are using an iOS 7.1 or later, it is not possible to click the Install button.
      Instead, you can install the application from the Mobile Devices view:

      missing_alt

      missing_alt

    Everything that you do with the application is recorded and sent to the test workbench. For example, the script records when you press a button or when you enter text in an entry field.

  2. To stop recording, close the application by clicking Home (iOS) or Back (Android).

    A message that reports the availability of a new recording is displayed on the test workbench.

    missing_alt

  3. Follow the wizard instructions to generate a test from the recording. You are asked to store the test in the test project.

For more information about how to create a test, see the "Rational Test Workbench Mobile Test Edition" user documentation topic.

Editing a test

After the recording, you can edit the test in the natural language editor.

missing_alt

You can edit the test to insert verification points (for example, to verify the value of a user interface element), to replace recorded test values with variable test data, or to add dynamic data to the test.

missing_alt

Running a test

missing_alt

Run a test to ensure that the app matches the expected behavior as defined in the verification points.
During the test, each verification point is checked and receives a pass, fail, or inconclusive status.

The available tests are visible in the mobile client and you can run the test from this application.

For more information

For more information about IBM MobileFirst Platform Foundation functional testing and the IBM Mobile Test Workbench, see Testing with IBM MobileFirst Platform Foundation in the user documentation

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on December 02, 2015