Mobile application testing with Rational Performance Tester

How to record a test script

Comments

The number of mobile client applications that connect to the Internet is growing exponentially. It is important to understand the effect of these increasing connections to make good decisions about how to optimize the performance of the back-end.

This article demonstrates how to record the HTTP traffic to and from mobile client applications, directly from the built-in proxy recorder of IBM® Rational® Performance Tester.

Connect a mobile device to a dedicated wireless network

This is a quick and simple procedure that requires you to select the Network Service Set Identifier (SSID) of the wireless network that you want to connect to if it is visible in your device, and to connect to the network after you provide the required password. Another, more secure way to connect to a wireless network is to use Digital Certificate Client Authentication.

For the purpose of this exercise, assume that your mobile device is connected to a wireless network.

Configure the mobile device proxy

The system on which the Rational Performance Tester is installed needs to be set up as a proxy server to record communication between the mobile device and the Internet. This setup relays all mobile network traffic through the Rational Performance Tester's recording proxy.

Configuration instructions for an Android device

From your Google® Android™ device, navigate to Settings > Wireless network > WIFI. Press and hold the selected network. Choose Modify network and select Show advanced options.

Set the following options, as shown in Figure 1:

  • Proxy settings: Manual.
  • Proxy hostname: The IP address of the computer that hosts Rational Performance Tester.
  • Proxy port: The Rational Performance Tester listening port. The default is 1080.
  • Bypass proxy for: Leave this field blank.
  • IP settings: DHCP.

Save your changes.

Figure 1. Android proxy settings
IP address, proxy settings, hostname, port
IP address, proxy settings, hostname, port

Configuration instructions for an iOS device

On your Apple® iOS® device, navigate to Settings>Wi-Fi and tap on your connected network. In the HTTP PROXY section, tap manual and enter the following settings, as shown in Figure 2:

  • Server: The IP address or the host name of the computer that hosts Rational Performance Tester.
  • Port: The Rational Performance Tester listening port. The default is 1080.
  • Authentication: Do not enable.
Figure 2. Proxy setting for an iOS device
IP address, server, port, authentication for iOS
IP address, server, port, authentication for iOS

Record and generate test scripts

To start recording, follow these steps:

From the Rational Performance Tester project, right-click the folder where you want your recording to be located. Then select New> Test From Recording as shown in Figure 3.

Figure 3. Start a new recording
Navigate to Test From Recording option
Navigate to Test From Recording option

Select HTTP Test in the Recording Session window and click Next, as shown in Figure 4.

Figure 4. Selecting HTTP protocol for your recording
HTTP Test selected. Click Next.
HTTP Test selected. Click Next.

Provide a name for this recording and click Next, as shown in Figure 5.

Figure 5. Provide a name for your recording
Test name example: testing
Test name example: testing

Mobile devices cannot be managed by Rational Performance Tester, therefore you must select Unmanaged Application in the Client Application window and then click Next, as shown in Figure 6.

Figure 6. Select Unmanaged Application for client application
New Test Recording > Unmanaged application
New Test Recording > Unmanaged application

Make sure that the Proxy Recorder Settings reflect the settings shown in Figure 7 then click Next.

Figure 7. Specify the settings for recording network traffic with the proxy recorder
Proxy type HTTP, Proxy port 1080, Direct connection
Proxy type HTTP, Proxy port 1080, Direct connection

Accept the Privacy Warning and then click Finish to start recording, as shown in Figure 8.

Figure 8. Accept the Privacy Warning
Click Accept for privacy warning
Click Accept for privacy warning

From your mobile device, navigate through your installed application to start the recording. If all settings are configured correctly, you can see some activities on the Rational Performance Tester Proxy Recorder tab during recording, as shown in Figure 9.

Figure 9. Recorder accepting connection
Displays recording activities
Displays recording activities

To pause your recording while navigating to other sections of your mobile app that need no recording, press the Pause/Resume Recording solid red button, as shown in Figure 10. Press the button again to resume recording.

Figure 10. Pause/Resume recording
Click to pause or resume recording
Click to pause or resume recording

Note: You cannot name a page while you are using an unmanaged recording in Rational Performance Tester. Therefore, you might need to add comments to identify the operation being recorded, as shown in Figure 11.

Figure 11. Button to insert comments
Click the first icon after Test Annotations
Click the first icon after Test Annotations

Insert your comments in the text field, as shown in Figure 12.

Figure 12. Text field to insert comments
Type a comment in the comment field. Press OK.
Type a comment in the comment field. Press OK.

When you finish recording all needed transactions from your mobile application, press Stop, as shown in Figure 13, to stop recording.

Figure 13. Blue button to stop recording
Press solid blue square icon
Press solid blue square icon

This action generates the test script, which you can customize for your workload, as shown in Figure 14.

Figure 14. Prompt to open the recorded test
Test Generation completed. Press Close or Open Test.
Test Generation completed. Press Close or Open Test.

Summary

This article explains how to record mobile network traffic using the Rational Performance Tester recording proxy. These steps can be applied with any mobile device for the purpose of generating workload test scripts.


Downloadable resources


Related topics


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=967547
ArticleTitle=Mobile application testing with Rational Performance Tester
publish-date=03182014