Recording mobile device traffic for performance testing mobile HP Loadrunner1

上一篇 / 下一篇  2014-05-19 17:50:55 / 个人分类:performance testing

Want to write a performance test that will replicate the traffic of an actual hardware device such as an iPad, iPhone or Android device? This article covers a useful technique to capture and replay the network traffic of real mobile devices.

In my previous blog the Android SDK’s emulator has been used to run the mobile client application and Loadrunner Virtual User Generator’s (VuGen) recorder was wiretapping and recording its network packets.
The approach is quick and comfortable, however it may not be viable for other platforms.
For instance, there is no iOS emulator for Windows (and there is no VuGen for MacOS either).

To bridge over the distance between the device and the recorder, the client device’s traffic should be diverted to the Loadrunner VuGen machine for capturing.
To accomplish this, a custom DNS server has to be set up.  This makes the device believe that VuGen is the server it is connected to. Loadrunner VuGen acts as a proxy – so it captured packets between the device and the web-server and generates a performance script. from the traffic.

The DNS server is configured to spoof the mobile device and diverts the client to the Loadrunner recorder. VuGen records the traffic and forwards the traffic between the client and the server

Please note, that this is a general solution, and not restricted solely to mobile devices. However for conventional applications it is in most cases easier to reconfigure the application to reach out to a different host, but this is usually not the case for mobile apps.

Connect the device and the HP Loadrunner VuGen host

This can be done practically e.g. using a Wifi router. Link the router to your Loadrunner PC via Ethernet and connect the mobile device to the Wifi.

Get the mobile application ready

The mobile application must be installed onto the device and checked to see if is working as expected (and communicates well with the web service)
In this example I used the Wiktionary example from the previous blog.

Set up the custom (spoofing) DNS server

I’ve chosen to use MaraDNS , an open source DNS implementation, due to its simplicity and multiplatform. availability.
Download MaraDNS and unzip it.
For simplicity I placed it on the Loadrunner VuGen machine, but it can be run on any other host if you like.

Configuration:

We know the Wiktionary application communicates with the en.wiktionary.org host.
Therefore the DNS will be configured to provide the IP address of the Loadrunner VuGen machine for the en.wiktionary.org hostname.

Replace the “mararc” configuration file with the following:
(substitute the IP 11.22.33.44 below with the IP address of the appropriate network card of the VuGen machine – use the ipconfig command to find that out)

1
2
3
4
5
6
7
8
9
# defines the ip addresses on which the DNS service will be available
# here is the localhost and the Ethernet card's IP of the Loadrunner:
ipv4_bind_addresses ="127.0.0.1,11.22.33.44"
timestamp_type = 2
random_seed_file ="secret.txt"
verbose_level = 3
csv2 = {}
# specifies our custom domain and the zone file
csv2["wiktionary.org."] ="db.wiktionary.org"

Create a new file in the MaraDNS directory with the name “db.wiktionary.org”:

1

TAG:

 

评分:0

我来说两句

Open Toolbar