Previously I described ways to test mobile device applications (Andoid, iOS, etc.) with an emulator and with the actual ”hard” device utilizing Loadrunner 9.5x. In this article I will summarize my experience with Loadrunner 11.
Loadrunner 11 Patch release #3 features two new mobile-related virtual user script types: Mobile Truclient (which embraces Hp’s Truclient AJAX facility purposed for Mobile website testing) and Mobile Apps (which enables testing native mobile applications). As we are interested in applications rather than web sites, let’s focus on the latter.
The goal of this adaptor type is replaying the network traffic between the mobile application and the associated webserver. It assits the capture of the mobile traffic and then converts it to the Loadrunner format.
To facilitate this, the Mobile App script editor in VuGen offers the following recording options:
Record script using a mobile device emulator: this option allows script editors to start an external emulato, and will capture the network traffic of that process. We can use this same approach with Loadrunner 9.5.x
Analyze traffic using existing capture file to generate script: here a network traffic capture tool’s output can be used to generate the script.
The process is straightforward:
- Install the capture tool on a webserver,
- Capture the traffic
- Let Loadrunner generate the performance script.
The Loadrunner installation already contains the lrtcpdump utility (which is already in LR9.5x for webservice capturing).
I tested the Linux variant on CentOS 5 (32 bit) and it worked perfectly.
You might need to perform some extra installation steps, e.g. install C++ library (yum install libstdc++.so.5), in case you receive „./lrtcpdump: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory”)
Alternatively the tcpdump tool can also be used (contained in most Linux distributions)
tcpdump -s 0 -w mycapturefile.cap
After the server’s traffic is captured by your chosen capture tool, the target capture file needs to be transferred to the VuGen machine. The VuGen can postprocess the capture file and transform it to a regular web-script.
This technique can be used for a variety of other applications . E.g. You could use this to capture the HTTP traffic of any application (browser or not) which is not possible via the sole use of the Virtual User Generator.
The enhanced way of collecting captured traffic is to Use a mobile sniffer agent. This agent is an HTTP server and a capturing utility. After installing it on the webserver, VuGen attaches to it and starts and stops capturing without manual intervention and the need for file transfers.
The Bottom line:
The Loadrunner 11 mobile device script editor is useful for converting captured network traffic to a traditional HTTP user script. Using either the provided toolset (lrtcpdump, mobile sniffer agent) or the conventional capturing tools (tcpdump) will greatly assit productively and help you produce performance scripts for mobile playback.