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.
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:
- 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.
- 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.
- 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:
- In the Test Navigator view, right-click the mobile devices node and select the Available Mobile Devices to open the mobile devices editor.
- In the editor, click the icon Add device to listFigure 1 to add a device to the list.
- On the mobile device, start the mobile client.
- 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:
- Log in to Keynote® DeviceAnywhere® Studio and acquire a device, as shown in Figure 1.
Figure 1. Acquire a device
- Launch the Rational Test Workbench and click the Display available mobile devices icon Figure 1 in Rational Test Workbench. The Add New Device wizard displays the workbench URL, as shown in Figure 2.
Figure 2. Workbench URL
- Open a web browser and type the workbench URL, as shown in Figure 3.
Figure 3. URL on the device
- 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
- Open the download location and install the mobile client, as shown in Figure 5.
Figure 5. Install the mobile client
- 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
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
Add applications to the Rational Test Workbench:
- In the toolbar of the Rational Test Workbench perspective, click the Display available mobile applications icon.
- In the mobile applications editor as shown in Figure 8, click the Add applications to list icon .
- 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
- 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
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:
- 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
- When the application starts, interact with the device. All your actions on the device and responses from the application are recorded.
- 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
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
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
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:
- In the mobile test client, tap Managed Apps, and tap the application under Test.
- 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
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:
- From the test navigator, expand the project folder and double-click the test reports.
- 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
To view the test reports from a mobile device:
- Open the mobile test client and tap Managed Apps.
- Select the application for which you want to view the results.
- 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
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
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.
- Find out more aboutRational Test Workbench.
- Visit Rational Solution for Test Automation, 8.5.1 for an introduction to Rational Solution for Test Automation.
- Watch the video Perform mobile tests on KeyNote DeviceAnywhere with Rational Test Workbench (3:34).
- Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
- Explore Rational computer-based, Web-based, and instructor-led online courses. Hone your skills and learn more about Rational tools with these courses, which range from introductory to advance. The courses in this catalog are available for purchase through computer-based training or Web-based training. Additionally, some "Getting Started" courses are available free of charge.
- Browse the technology bookstore for books on these and other technical topics.
- Stay current withdeveloperWorks technical events and webcastsfocused on a variety of IBM products and IT industry topics.
- Check theRational training and certificationcatalog, which includes many types of courses on a wide range of topics. You can take some of themanywhere, anytime, and many of the Getting Started ones are free.
Get products and technologies
- Download Rational Test Workbench, which includes Rational Integration Tester, fromPassport Advantage.
- Download trial versions of IBM Rational software
- Download these IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Tivoli®, and WebSphere®.
- Get involved in the developerWorks Functional and GUI Testing forum, which is a place for users of Rational Functional Tester to discuss testing topics.
- Check out developerWorks blogs, and get involved in the developerWorks community.
- Get connected with your peers and keep up on the latest information in theRational community.
- Ask and answer questions and increase your expertise when you get involved in theRational forums,cafés, andwikis.
- Rate or review Rational software. It's quick and easy.
- Share your knowledge and help others who use Rational software bywriting a developerWorks article. Find outwhat makes a good developerWorks article and how to proceed.
- Follow Rational software onFacebook,Twitter(@ibmrational), andYouTube, and add your comments and requests.
Dig deeper into Rational software on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Keep up with the best and latest technical info to help you tackle your development challenges.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.