Mobile testing with IBM Rational Test Workbench

A step-by-step guide

In this article, you will learn how to perform mobile testing using IBM Rational Test Workbench version 8.5 and Android x86 4.0.3 virtual machine.

Pragati Maheshwari (pragati.maheshwari@in.ibm.com), Software Engineer, IBM

author photoPragati Maheshwari, is a software engineer who works with the IBM Rational Functional Tester testing team in India. She joined IBM India Software Labs in September 2006 and has contributed to quality improvement in the testing tools. She has also worked on Rational Quality Management and Rational Team Concert software.



27 August 2013

Also available in Chinese

In this article, you will learn how to perform mobile testing using IBM® Rational® Test Workbench version 8.5 and Android x86 4.0.3 virtual machine.

Prerequisites

  • IBM Rational Test Workbench version 8.5
  • Android 2.2 - 4.2
  • For Android
    • Android SDK 21 installed

Note: The mobile device must have a working Internet connection. Also, the mobile device must be on the same network as the computer that is running Rational Test Workbench and should be able to ping that computer.


Support for testing native and hybrid applications

You can use Rational Test Workbench to test both native and hybrid applications. A native Android or iOS application is built using a native SDK, whose services are defined according to each platform architecture. Android applications are typically created with Java or C++, whereas iOS applications are created using Objective-C.

A hybrid application is an application that combines native and Web technologies. The Web part relies on HTML 5, CSS3, and JavaScript.

Stages in the mobile testing process

To help you to meet your goals, Rational Test Workbench implements the following stages in the testing process:

  • Installation and configuration: Set up your test environment with Rational Test Workbench and the SDKs for the mobile operating systems. Install the mobile test client on the mobile device. Ensure that the mobile device has Internet connectivity, and add that device to the test workbench.
  • Application preparation: Import the application that you want to test into the test workbench.
  • Test recording: Run the application from the mobile test client to start a recording. The recorder application records all user interactions, sensor inputs, and application behavior and then uploads the recorded data to the test workbench, where it can be converted into a mobile test.
  • Test editing: After recording is done, you can edit the test in the natural language editor. You can use the mobile data view to display and select UI elements from the recorded applications. You can also replace recorded test values with variable test data or add dynamic data to the test.
  • Testing: Deploy and run automated tests on multiple devices to ensure that the application matches the expected behavior defined in verification points. During the run, each verification point is checked and receives a pass, fail, or inconclusive status, and functional data is recorded.
  • Evaluation of results: After the test, the device uploads the test data to the test workbench. Functional reports provide a comprehensive view of the behavior of the application under test. Reports can be exported and archived for validation.

Set up the environment for mobile testing

What follows is the detailed description for setting up the environment for performing mobile testing using Rational Test Workbench.

Installing the mobile test client on Android

To perform mobile testing using Rational Test Workbench, first you have to install the mobile client on the mobile device. Below are three ways you can do this:

Installing the mobile test client for an Android mobile device

To record and run tests from your Android mobile device, you must install the Android Rational Test Workbench Mobile Client on the device. Here are the steps to download the installer in order to install the client on the device:

  1. In Rational Test Workbench, select File > New > Device. A window displays the URL of the workbench and a QR code that contains the URL.
  2. Depending on the mobile device, perform one of the following steps:
    • If the mobile device is equipped with a camera and a QR code-reading application, then run the QR code application and flash the QR code that is displayed on the workbench screen.
    • If the mobile device cannot flash a QR code, open the web browser and go to the URL that is displayed on the workbench screen. The mobile device displays a webpage with the download link for the mobile test client.
  3. In the mobile web browser, tap the link to download the mobile test client installer. After the download completes, tap the complete button.

If the mobile test client does not install automatically, use a file manager application to locate the APK installer file (usually in the Downloads folder) and run the installer manually.

Installing the mobile test client for Android with adb

On some mobile devices, it might not be possible to install the Android IBM Rational Test Workbench Mobile Client by downloading the installer. This topic describes an alternative installation method that uses a USB connection and the adb tool that is provided with the Android SDK.

To install the mobile test client for Android with adb, follow these steps:

  1. In the test workbench, select File > New > Device. The Add New Device wizard shows the Workbench URL.
  2. Open a web browser, enter the Workbench URL, and download the mobile test client.
  3. Copy com.ibm.rational.test.mobile.android.client.ui-release.apk to a temporary folder, for example, C:\tmp.
  4. Open a command prompt window and point to the Android SDK directory that typically is C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools.
  5. Type the following commands:
    • adb connect <IP address of workbench computer>
    • adb install <temporary folder>/com.ibm.rational.test.mobile.android.client.ui-release.apk

Installing the mobile test client for Android on an emulator

If the Android device is running on a virtual machine or on the emulator provided by the Android SDK, you can install the Rational Test Workbench Mobile Client either by downloading it or using the adb tool.

Configure the mobile test client for Android

To use an Android mobile device to upload mobile applications and record or run tests, you must configure the Rational Test Workbench Mobile Client to connect to Rational Test Workbench. To add a mobile device to the test workbench follow these steps:

  1. In the Test Navigator view, right-click the Mobile devices node and select the Available Mobile DevicesDisplay mobile devices icon The Mobile Devices editor opens.
  2. In the editor, click the icon Add device to listAdd device to listto add a device to the list.
  3. On the mobile device or on an emulator, start the mobile client.
  4. Complete one of the following steps:
    • If the mobile device is equipped with a camera, tap the QR code button and scan the QR code that is displayed on the test workbench. This step is not applicable to the emulator.
    • Tap Set Workbench > Address and type the URL manually.

The name and properties of the device are displayed in the test workbench, in the Mobile Devices editor.

Managing mobile applications

Before you start to record a test from an Android or iOS application, you must use a mobile device to upload the application under test or import the application to the test workbench. With the mobile application editor, you can manage your applications in Rational Test Workbench.


Hands-on experience

Add a mobile device in Rational Test Workbench by following these steps:

  1. Launch IBM Rational Test Workbench, and start Android x86 4.0.3 virtual machine.
  2. Click the Display available mobile devices icon Display mobile devices icon in Rational Test Workbench. The Add New Device wizard displays the workbench URL as shown in Figure1.
Figure 1.Workbench URL
Display workbench URL with QR code
  1. Open a web browser, type the workbench URL, and click the Proceed with Android instructions link, as shown in Figure2.
Figure 2. Mobile Welcome Page
Display mobile welcome page
  1. Click on the Click here to start download link as shown in Figure3, and download the mobile client for Android OS.
Figure 3.Android Welcome Page
Download mobile client for Android
  1. Now go to the Android x86 4.0.3 virtual machine, and check the IP address as shown in Figure 4.
Figure 4. IP Command
Check the ip address
  1. Run the following command to connect Rational Test Workbench and start Android x86 4.0.3 virtual machine.
    • Go to the ../adt-bundle-windows-x86_64\sdk\platform-tools directory.
    • Execute the adb connect <ip address of vm> command as shown in Figure 5.
Figure 5. Connect command
Run command to connect
  1. Install the mobile client (downloaded above) into Android x86 4.0.3 virtual machine using the adb install –r
    ../com.ibm.rational.test.mobile.android.client.ui-release.apk
    command as shown in Figure 6.
Figure 6. Install command
Run command to install
  1. Go to the Android x86 4.0.3 virtual machine, and launch RationalTest Workbench Mobile Client.
  2. Enter the workbench URL in the Configure Workbench field as shown in Figure 7.
Figure 7. The Configure Workbench window
Configure workbench on the mobile device

Now, in Rational Test Workbench the Android x86 4.0.3 mobile device is available as shown in Figure 8.

Figure 8. Available mobile devices
Display available mobile devices

To add applications to Rational Test Workbench, follow these steps:

  1. In the Rational Test Workbench perspective's toolbar, click the Display available mobile applications icon.
  2. In the Mobile applications editor, click the Add applications to list icon.
  3. To add an application from your local computer, in from local storage, click the Android app icon. Provide location of the application, then click Next. Select a project, and click Finish.
Figure 9. Mobile applications
Display mobile applications
  1. In the mobile test client, go to Managed Apps, then tap the application that you added to the test workbench.
Figure 10. Managed applications
Display managed applications

To create mobile tests, record a session on the mobile device that runs the application being tested. At the end of the recording session, close the application, and the Rational Test Workbench Mobile Client uploads the recorded session to Rational Test Workbench, where it is used to generate a test.

To create a mobile test, follow these steps:

  1. In the mobile test client, tap managed apps, select an application from the list, and then tap record as shown in Figure 11.
Figure 11. Record
Start recording, red circle icon

2. When the application starts, interact with the device. All your actions on the device and responses from the application are recorded.

3. To end the recording, close the application. The recording is uploaded to the test workbench. Recordings are displayed in the test navigator under Mobile Incoming Recordings.

Figure 12. Mobile test
Display mobile test

Editing mobile tests

With the test editor, you can view or customize a mobile test that you recorded. You can use the Mobile Data view to select user interface elements and add some verification points, and to create or modify steps in the test with simplified scripts. Or you can create or modify a set of steps manually directly in the test script.

Figure 13. Adding a verification point
Add a verification point

Running mobile tests

You can run a mobile test, either from a device or from the test workbench.

To run a test from the test workbench in the Test Navigator view, open the test and, in the test editor, select the Run button as shown in Figure 17.

Figure 14. Run a mobile test from the test workbench
test calculator test window

The test is played back in the mobile device. Do not interact with the mobile device until the test is completed.

To run a test from an Android mobile test client, follow these steps:

  1. In the mobile test client, tap Managed Apps, and tap the application under Test.
  2. To view the list of tests available for the application, tap Test.
  3. Tap the test script, and then tap Run Test.
Figure 15. Run mobile test from Mobile Test Client
Run a mobile test from mobile device

The test is played back in the mobile device. Do not interact with the mobile device until the test is completed.

Evaluating results:

To check whether the mobile test ran successfully open the test report. You can also view each recorded functional action in the report.

Viewing mobile reports:

When you run a test from Rational Test Workbench, you can view both the mobile web report and the statistical report in the test workbench. From the Test Navigator, expand the project folder and double-click the test reports. Follow these steps:

  1. From the Test Navigator, expand the project folder and double-click the test reports.
  2. If the Test Navigator is logically arranged, expand the project folder, expand the Results folder, and open reports.

If you have initiated the test run from the device, the mobile reports are stored in the Mobile Results folder.

Figure 16. Mobile report
Mobile test report from mobile device

Click to see larger image

Figure 16. Mobile report

Mobile test report from mobile device

To view the test reports from a mobile device, follow these steps:

  1. Open the mobile test client and tap Managed Apps.
  2. Select the application for which you want to view the results.
  3. Tap Test, and tap a test for which you want to view the reports. Tap Reports to open a mobile report.
Figure 17. Mobile report from the mobile client
Mobile test report from mobile device

Click to see larger image

Figure 17. Mobile report from the mobile client

Mobile test report from mobile device

Viewing test logs

To see a record of all the events that occurred during a test run or a schedule run, as well as the status of each verification point, open the test log for that run. In the Test Navigator view, right-click the executed test; then click Display Test Log.

Figure 18. Test log
Display test log

Summary

If you follow the steps specified in this artile, you can automate the creation, execution, and analysis of functional tests for native and hybrid applications on Android and iOS devices using IBM Rational Test Workbench.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational, DevOps, Cloud computing, Mobile development
ArticleID=941933
ArticleTitle=Mobile testing with IBM Rational Test Workbench
publish-date=08272013