Use Proxy Recording in LoadRunner 11.52 for Mobile Applications

This post was written by Zhi-Yuan Jing (Jason), from the HP LoadRunner R&D team.

 

There are two ways that network traffic to and from mobile devices can be recorded in LoadRunner.  You can install the HP LoadRunner Mobile  Recorder application on your Android mobile device, or you can use the proxy recording mode.  This article discusses the proxy recording mode.  For information about the Mobile Recorder application, see the short tutorial posted recently on this blog.

 

In LoadRunner 11.52, a new proxy recording mode was provided. This feature provides a new approach for users to record web applications. It doesn’t require installing any client on mobile devices, so it is particularly suitable for recording mobile applications. It can also be used for desktop operating systems on which VuGen can’t be installed, such as Linux, Mac OS, etc.

 

You can download HP LoadRunner here to experience it in your environment.

 

Introduction

LoadRunner veterans may know that a proxy mode already exists in previous releases of LoadRunner. The old proxy mode has limitations, such as:

 

  • It uses the older recording engine, so it can’t generate all the steps supported in the current engine.
  • The script can’t be regenerated once it’s created.
  • It doesn’t work well with Secure Socket Layer (SSL, or HTTPS).

The older proxy mode is still available, by choosing Recording Options > HTTP Properties > Advanced, and checking the “Recording script using earlier recording engine” checkbox, but the new proxy recording mode has an enhanced engine which fixes most of these problems.

 

Users can conveniently record mobile applications via proxy recording. While this mode can work with web applications, it can also record native mobile applications that use HTTP and HTTPS as the transport.

 

Here are the general steps to use the new proxy recorder:

1.  In VuGen, create a new script of type "Mobile Application - HTTP/HTML".
2.  Click the red Start Recording button.  The last of the four options that are displayed, Proxy Recording, is new to version 11.52: 

 

p1.png


3.  On your VuGen machine, configure your Internet Explorer Settings to use your company’s proxy setting if you have one. VuGen uses your default internet proxy setting to access the internet. This step is optional, and is usually only needed when your application under test needs to access the internet and you are connected to a corporate network which requires a proxy to access the internet.

 

p2.png

 

4.  Configure your mobile device to use the VuGen Recording Proxy. For example, on an iOS device, the setting is Settings > Wi-Fi > HTTP Proxy > Manual.  Configure the server to be the IP of the VuGen machine, and the Port to be the port that VuGen is listening on.

 

The following screenshot shows how to configure the proxy setting for an iPhone. Android devices have a similar setting.

 

p3.png

 

 

5.  You can now open your application from the browser on your mobile device, and all the web traffic will be recorded by VuGen. 

  

Once you configure the Wi-Fi (WLAN) proxy setting, it will apply to all communication to and from the mobile device, which means that you might record traffic that is not related to your application, such as your email client. This noise can be removed manually after the script is generated.

 

HTTPS (SSL/TLS) Support

If your web application is using SSL, some extra steps are required to configure a certificate in order to record the application. To record traffic, the VuGen recording proxy acts like a man-in-the-middle, and uses its own certificate to set up a secure connection with the mobile device, and uses the certificate of the real server to establish a secure connection with the server. In this way, it can decrypt HTTPS traffic. To make the browser work with the VuGen Recording Proxy over a secure connection, you need to either declare a security exception, or install a root certificate. Please refer to the topic How to Record a Script via a Proxy in LoadRunner VuGen’s help for more details on how to install a certificate. 

 

The proxy recording engine currently supports HTTPS up to TLS 1.0. Therefore, if your application or server uses TLS 1.1 or higher only, you need to downgrade the TLS version (i.e. enable the lower version) in the client in order to record it correctly.

 

Note that some native mobile applications have their own rules to decide whether or not to accept certain types of certificate. In this case, it might reject the LoadRunner certificate even if you have installed the root certificate on the device, and the HTTPS traffic may still fail to record. If this happens, contact your application’s developer for help to work around it.

 

Web Recording Toolbar

The Web Recording Toolbar is a cool feature in proxy recording. When using traditional recording methods, VuGen displays a toolbar that users can use to control the recording, e.g. start/stop recording, and add transactions, data points or comments. When you record on a mobile device, it is not always convenient to do these operations because VuGen recording toolbar now is on a different machine.

 

For the best user experience, we created a web toolbar that can be displayed in the user’s web application, so that user can send all these controlling commands when recording in mobile devices. The following screenshot shows how it is displayed inside the web page. Even though it is embedded in the web page, the traffic of web toolbar will not be recorded in the script, so it won’t affect the load on the application. To use it, turn it on when you start recording by checking the Display recording toolbar on client machine option, since by default the checkbox is not selected.

 

p4.png

 

If you don’t want to embed it in your own web page, you can close the toolbar from the web page. Alternatively, you can open a separate tab in your browser which shows only the toolbar. Just type any URL in a new tab, and append the query string “tag=LoadRunnerToolbar” (case sensitive) to it, for example, http://www.hp.com/?tag=LoadRunnerToolbar.  The tab will display this toolbar on the page, and you can use it to control the recording. For this approach, you will find yourself switching quite often between your web application’s tab and the web toolbar’s tab. However, this is still easier than switching operations between the mobile device and VuGen machine.

 

The web toolbar has been tested on popular browsers, such as Internet Explorer, Chrome, Firefox, iOS and Android browsers.

 

More Information

Some mobile native applications cannot be recorded in proxy mode. For example, the device might not support proxy, or the application simply ignores the device’s proxy. In these cases, other approaches might help, such as “Record and Analyze Traffic” which records the traffic on the server side.

 

During recording, you can check whether the recording is working as expected by checking that the number of events on toolbar title is increasing (see the following screenshot of the toolbar). The events does not show on the mobile device’s web recording toolbar for performance reasons.

 

p5.png

 

 

We have discussed how to use proxy mode to record mobile applications. This mode is also available in the Web – HTTP / HTML protocol. In the following screen, you can see this new option when you create a Web protocol script. 

p6.png

 

 

 For more details on how to record in proxy mode, you can open  the “HP Virtual User Generator Help”, and browse to VuGen > Working with VuGen > Recording > How to Record a Script via a Proxy.

  

 

Leave us a comment in the box below if you are using proxy recording for your mobile applications.

  

 

Click here to learn more about LoadRunner.

 

You can download HP LoadRunner here.

 

Thanks to Jason for providing this article!



 

MobileTestingWhitepaper.png

Comments
HP Expert | ‎07-31-2013 10:13 PM

I can honestly say that using proxy recorder enabled me to recorded a massive business processes via mobile device to capture native and web based application in a few minutes without the need to have Vugen directly installed.

It also helped me to eliminate the need of an awkward 3rd party simulators which would have taken a LOT of my time.

 

To conclude - ANOTHER GREAT FEATURE! 

sunayana1318(anon) | ‎10-22-2013 10:07 PM
Hi Jason, Iam using a native ios7 ipad applucation to be recorded...the app uses a https comm protocol to communicate wit the server. Need to know more detail about certificate installation
HP Expert on ‎10-23-2013 11:50 PM - last edited on ‎10-23-2013 11:58 PM

Hi Anon,

 

Regarding your question on how to install a certificate on iOS device, please first  download the proxyroot.cer certificate to your desktop machine that will connects your iOS device, by navigating to http://<computer name of VuGen machine>:port/proxyroot.cer or http://<ip address of VuGen machine>:port/proxyroot.cer.

 

And then then follow the link below to install the ProxyRoot.cer certificate, it has good explanation on each step:

 

http://wiki.cylonmobile.com/home/add-ca-certification-authority-to-iphone

 

Please note that in the steps above, there is one to select a certificate to install from your personal certificate store, please select “DO_NOT_TRUST…” certificate.

 

Once installed on your device, then you can use your iOS browser to navigate to a https site through the LoadRunner VuGen recording proxy. Please note that you will still get warning dialog on your device browser window, and you need to select “Continue” in order to proceed.

sunayana1318(anon) | ‎10-25-2013 04:26 AM

Hi Jason,

 

To download the certificate these are the steps i have followed:

 

1. My vugen m\c and ipad on same wifi

2. Running the LR proxy (port 8080)

3. Configured proxy on my ipad as (ip: vugen m\c ip, port 8080)

4. on my ipad browser http://<computer name of VuGen machine>:8080/proxyroot.cer


This gives an error profile cannot be installed on ipad...Please advice if the steps followed is right?

 

 

HP Expert | ‎10-27-2013 07:21 AM

Hi Anon,

 

Please note that in the previous comments, we suggested "first  download the proxyroot.cer certificate to your desktop machine", and then install it on to your iOS device using "iPhone Configuration Utility". So your action of downloading it directly on iOS browser does not work.

 

If you exactly follow the above suggested steps and it is still not working, I recommend that you open a support ticket, or post the question on the LoadRunner Support Forum (at http://h30499.www3.hp.com/t5/LoadRunner-Support-Forum/bd-p/sws-LoadRunner_SF#.UmkmH_k25yw)

 

 

Samir Modh(anon) | ‎01-28-2014 02:50 AM

Hi Team,

 

This is very helpful information related ot the LR capabilities of recording mobile application. I followed these steps accuratly, however I am not able to record any mobile communication through LR proxy. I varified many options with no luck yet. I request to help me with this regard. Do I need to take care of any specific proxy related sattings?

HP Expert | ‎02-02-2014 04:43 AM

Hi Samir,

 

As mentioned in the previous post, you can get help from community by submitting a post to LoadRunner Support Forum, or from HP by submitting a service request to HP. And we love to help you by first understanding more details of your environment.



Narendar(anon) | ‎02-16-2014 05:53 AM

Hi, I have followed all the steps mentioned but my mobile is unable to connect to any site for recording. i am using samsung mobile with android 4.0.4 . any help will be appreciated. thanks in advance.

HP Expert | ‎02-17-2014 10:16 PM

Hi Narendar,

 

Some trouble-shooting tips:

 

Proxy recording feature is just like a proxy, therefore, to trouble-shot, you can use some other proxy tools try see whether you can connect to your site from your Samsung phone. For example, with Fiddler, you can capture the traffic similarly, just don’t generate the script. If you cannot connect to site either with Fiddler, that should be a configuration issue that you can do some further check.

 

If you still cannot succeed after all the trouble-shooting steps, you can open a support ticket to get help from HP support.

 

Jason

Narendar(anon) | ‎02-25-2014 09:02 AM

Thanks Jason,

I am able to connect from my mobile to Laptop with fiddlers port(8888), but unable to record script with 8080(http port) . the events are not getting generated in LR and page is not getting loaded in mobile. i tried with multiple browsers and ports but no luck.

raghu1006(anon) | ‎03-21-2014 01:12 AM

Hi Jason,

 

Can we record the scripts for Native mobile applications in ipad & Android using the HP Load Runner 11.52. 

 

Any help will be appreciated.

 

Thanks in advance.

 

Raghu

HP Expert | ‎03-25-2014 06:30 PM

Hi Raghu,

 

for Android, we already have a component "LoadRunner Mobile Recorder" which is in release 11.52 or later. It is an Android application that can record traffic for other applications on the same device. It requires the device to be rooted to record. Check the article HP LoadRunner Mobile Recorder – a short tutorial for more details.

 

For iOS, you can still use Proxy Recording feature if no SSL is involved. If it uses SSL, there are probably need some trick in the code of your native application to accept Proxy-Recording certificate during the recording test, which is non-trusted certificated.

 

Another option is to record on the server side using network monitoring tool, and generate the pcap file. Then use LoadRunner to parse the pcap file, using "Mobile Application - HTTP/HTML" protocol.

 

Jason

 

 

HP LoadRunner Mobile Recorder – a short tutorial

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Search
About the Author
Malcolm is a functional architect, focusing on best practices and methodologies across the software development lifecycle.


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation