Test mobile applications with IBM Rational Test Workbench on Android devices hosted in Keynote DeviceAnywhere

A step-by-step guide

Learn how to perform mobile testing using IBM Rational Test Workbench version 8.5.1 on Android devices from Keynote DeviceAnywhere. Explore how to automate the tasks to create, execute, and analyze functional tests for native, hybrid, and web applications on Android devices.

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.



04 March 2014

Also available in Spanish

Introduction

The goal of mobile testing is to ensure that your mobile application meets the requirements that guide its design and development. The mobile testing capabilities of IBM® Rational® Test Workbench automate the tasks to create, run, and analyze functional tests for native, hybrid, and web applications on Android™ devices. Keynote® DeviceAnywhere® makes it possible for you to interact remotely with live mobile devices in real time so you can see exactly how your application under test looks and acts across a range of different mobile devices. Integration support for Rational Test Workbench and Keynote DeviceAnywhere means you can test mobile applications on multiple, real, live mobile devices. This article contains a detailed step-by-step process to perform testing of mobile apps that run on Android devices using IBM Rational Test Workbench on devices hosted in Keynote DeviceAnywhere.


Requirements

To use the instructions in this article, you need:

  • Access to an IBM Rational Test Workbench V8.5.1 environment
  • Access that makes it possible for you to acquire a mobile device from Keynote DeviceAnywhere. You can use the trial version of Keynote DeviceAnywhere.

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


Support for testing native, hybrid, and web applications

Rational Test Workbench can be used to test native, hybrid, and web applications on a mobile device:

  • Native: A native Android or iOS® application is built using a native software development kit (SDK), whose services are defined according to each platform's architecture.
  • Hybrid: A hybrid application is an application that combines native and web technologies.
  • Web: A browser-based web application is developed using pure web technologies.

Stages of mobile testing

Use the following steps to test your mobile application with Rational Test Workbench:

  • Set up the environment for mobile testing: 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.
  • Prepare the application: Import the application that you want to test into Rational Test Workbench.
  • Start a 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.
  • Edit the mobile test: After the recording is finished, you can edit the test in the natural language editor of Rational Test Workbench.
  • Deploy and run the mobile tests: Deploy and run automated tests on multiple devices to ensure that the application matches the expected behavior that is defined in the verification points.
  • Evaluate test results: After the test is finished, the device uploads the test data to the Rational Test Workbench.

Set up the environment for mobile testing

To set up the environment, you need to install and configure the mobile test client.

Install the mobile test client on Android mobile device from Keynote DeviceAnywhere

First, you need to acquire an Android device from Keynote DeviceAnywhere and install the mobile client on the mobile device. Download the installer 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 quick response (QR) code that contains the URL.
  2. Open the web browser on the device and go to the URL that is displayed on the Rational Test Workbench screen. The mobile device displays a web page with the download link for the mobile test client.
  3. In the mobile web browser, select the link to download the mobile test client installer. After the download is finished, select Complete.

Configure the mobile test client for Android mobile device from Keynote DeviceAnywhere

To use an Android mobile device to upload mobile applications and record or run tests, you need to 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 Devicesicon to open the mobile devices editor.
  2. In the editor, click the icon Add device to listiconFigure 1 to add a device to the list.
  3. On the mobile device, start the mobile client.
  4. 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.


Prepare the application

To test a mobile application, you need to upload the application under test using your Android mobile device or import the application to the test workbench. With the mobile application editor, you can manage your applications in Rational Test Workbench. Add a mobile device in Rational Test Workbench:

  1. Log in to Keynote® DeviceAnywhere® Studio and acquire a device, as shown in Figure 1.
Figure 1. Acquire a device
Acquire device highlighted in dropdown box
  1. Launch the Rational Test Workbench and click the Display available mobile devices icon iconFigure 1 in Rational Test Workbench. The Add New Device wizard displays the workbench URL, as shown in Figure 2.
Figure 2. Workbench URL
Display workbench URL with QR code
  1. Open a web browser and type the workbench URL, as shown in Figure 3.
Figure 3. URL on the device
Type the url on the device
  1. Click the Click here to start download link, as shown in Figure 4, and download the mobile client for Android OS.
Figure 4. Rational Test Workbench -- Android Welcome page
Download mobile client for Android
  1. Open the download location and install the mobile client, as shown in Figure 5.
Figure 5. Install the mobile client
Screen capture shows down arrow for downloading
  1. Launch the Rational Test Workbench mobile client on the mobile device and enter the workbench URL in the Configure Workbench field, as shown in Figure 6.
Figure 6. The Configure Workbench window
The Configure Workbench window

Alt=Configure Workbench on mobile device

In Rational Test Workbench the mobile device is available, as shown in Figure 7.

Figure 7. Available mobile devices
Display available mobile devices

Add applications to the Rational Test Workbench:

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

Start a test recording

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. 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 10.
Figure 10. Record a session on the mobile device
Start recording, red circle icon
  1. When the application starts, interact with the device. All your actions on the device and responses from the application are recorded.
  2. 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, as shown in Figure 11.
Figure 11. Mobile test
Test – calculator test is displayed

Click to see larger image

Figure 11. Mobile test

Test – calculator test is displayed

Edit the mobile test

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, as shown in Figure 12. You can also 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 12. Add a verification point
Screen capture shows adding a point

Deploy and run the 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 Run, as shown in Figure 13.

Figure 13. 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:

  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. Tap the test script, and then tap Run Test, as shown in Figure 14.
Figure 14. Run a mobile test from the mobile test client
Run a mobile test from the mobile device

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


Evaluate the test results

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

View mobile reports

When you run a test from Rational Test Workbench, you can view 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:

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

If you initiated the test run from the device, the mobile reports are stored in the mobile results folder, as shown in Figure 15.

Figure 15. Mobile report
Mobile test report from workbench

Click to see larger image

Figure 15. Mobile report

Mobile test report from workbench

To view the test reports from a mobile device:

  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, as shown in Figure 16.
Figure 16. Mobile report from the mobile client
Mobile test report from mobile device

Click to see larger image

Figure 16. Mobile report from the mobile client

Mobile test report from mobile device

View the test logs

To see a record of all the events that occurred during a test run or a schedule run and to see the status of each verification point, open the test log for that run. In the test navigator view, right-click the test that was run, and click Display Test Log to see a test log similar to Figure 17.

Figure 17. Test log
Display test log

Click to see larger image

Figure 17. Test log

Display test log

Summary

This article explains how to automate the tasks to create, run, and analyze functional tests for native, hybrid, and web applications on Android devices from Keynote DeviceAnywhere using 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, Mobile development
ArticleID=964608
ArticleTitle=Test mobile applications with IBM Rational Test Workbench on Android devices hosted in Keynote DeviceAnywhere
publish-date=03042014