Mobile tests are typically created by recording
a session on the mobile device or simulator that runs the app being
tested. At the end of the recording session, you close the app and
the IBM® Rational® Test Workbench Mobile Client uploads
the recorded session to the Rational Test Workbench , where it is used to generate a test.
About this task
This task applies to Android native applications, hybrid
applications and web applications. To be able to record a test from
a web application, you must have IBM Rational Test Workbench Mobile
Web Recorder installed
on your device. For details, see step 1 in the following procedure.
With
the
mobile test client for
Android, you can record all actions on the user interface (UI), plus
some actions on the phone itself: GPS locations, volume up and down,
mute, headphones plug, and all media actions (play, pause, and so
on), call, and end call. Camera and microphone functions are not supported.
Procedure
To record a session on the mobile device:
- In the mobile test client,
tap Managed applications for a native application
or Managed web applications for a web application.
The first time you tap Managed web applications,
a message shows up and asks if you want to install IBM Rational Test Workbench Mobile
Web Recorder. Tap Install and
when the installation is complete, tap Done.
- Tap an app in
the list and tap Record.
Note: If your device or emulator does not have silent
mode, the
mobile test client uninstalls
the original version of the application under test and replaces it
with the recording-ready app (instrumented version of your application).
During this process, tap the
Uninstall,
OK,
and
Install buttons accordingly. If your device
or emulator has silent mode, this process happens in the background.
To
make the silent mode option available on a device, you must connect
the device with a computer that has the Android SDK installed. Use
an USB cable and enable USB debugging. Ensure that you installed the
appropriate USB driver. Next, open the command prompt on the computer
and run the following commands:
- adb devices: Lists the devices connected
to the computer by the USB cable.
- adb tcpip 5555: Makes the silent mode option
available on the device.
You must follow these steps every time you reboot your device.
Silent
mode is not available on devices and emulators with API level 17 and
above (Android 4.2 +) due to a known limitation
- When the app starts, interact with the device. All your actions on the device and responses from the app
are recorded.
- To end the recording, close the app, switch to another
app, or tap the Home button. The recording is uploaded
to the test workbench.
Depending on the size of the recording, the upload might take a few
seconds to several minutes. Recordings are displayed in the test navigator
under Mobile Incoming Recordings with a name
and a timestamp.
Note: If
your session involves switching between apps, including multiple apps,
a new recording is uploaded each time you switch apps. This action
produces multiple recording logs in the Mobile
Incoming Recordings folder. You can combine these multiple
recordings to generate a single test.
- In the test workbench Test Navigator,
expand Mobile Incoming Recordings, right-click
a recording, and select Generate Test. Alternatively,
click the link in the message that warns you that there is a new incoming
recording. The New Test from Incoming Recordings window
opens.
- Select a project folder and a name for the new
test. If necessary, you can click to create
a new project folder.
- Optional: If you want to generate
a test with multiple recordings (for example, if your session involves
switching between multiple apps), click Next and
select the recordings that you want to use to generate the test.
- Click Finish and Open
test. The test editor opens
in the test workbench and
displays the generated test.
What to do next
When the test is generated, you can edit the
test in the test editor. For more information, see
Editing mobile tests.