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 recorded session is uploaded to the test workbench, where it is used to generate a test.
About this task
This task applies to native Android applications, hybrid applications, and web
applications.
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 connect and disconnect, 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 Manage
Applications for a native application or Manage Web Applications
for a web application. The first time you tap Manage 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 is set up with
USB Controller, which enables Android silent mode, this process happens in the
background.
To make the silent mode option available on a pre-4.2 device without the USB
Controller, you must use the following instructions. 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.
Without the USB
Controller, 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.