Está en la página 1de 12

04/08/2017 Mobile VuGen Scripting :: WilsonMar.

com
Topics this page:
Flowchart
Mobile VuGen Summary: App
Site Map

Types About this site


Scripting Load Testing
Emulators
Here is a compact yet deep technical Emulator Setup
step-by-step guide on how to create Emulator Record
VuGen scripts for emulation load PCAP Recording
PCAP Recording on Web Wilsonmar.com
from mobile apps on mobile Android
and Apple smartphones and tablets,
Device Search
Gen Script from
all in one page with clickable PCAP
flowcharts, wise tips, but without the Request Patterns
sales hype and confusing Network
generalities. Topics are presented in Monitoring
a sequence determined from a Other Tools
meticulous analysis of what needs to Your comments???
be learned first.

Related topics elsewhere on this


same website (WilsonMar.com):

1. Android Index - Gurus,


Websites, Books, Classes,
Videos, Chats, etc.
2. Android Versions
3. Android Mobile Devices
4. Mobile Carrier Selection
5. Android Watches
6. Android Device Usage Basics
7. Android App Side-loading
8. Android App Markets and
Reviewers
9. Android Utility Apps
10. Android User Apps
11. Android USB Connections
12. Android OS Rooting and
Rooted Apps
13. Android App Frameworks
14. Android Java Eclipse
Development Setup
15. Android Emulators
16. Android Java Programming
and Testing
17. Android App Localization and
Testing
18. Android Lifecycle and Testing
19. Android Data Management
and Testing
20. Android User Preferences
and Experience Features
21. Android UI Programming and
Testing
22. HTML5 Features
23. HTML5 Coding and Testing
24. Android User Controls Coding
and Testing
25. Android Hardware Control
and Testing
26. Android Services Coding and
Testing
27. Android App Monetization
28. Android App Marketing
29. Mobile VuGen Scripting for
Load Testing
30. Lua Programming

Flowchart: How It Works

http://www.wilsonmar.com/mobile_vugen.htm 1/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com

Pop-up this diagram to its own window

HP Mobile Performance Validation Overview


HP LoadRunner for Mobile demo by Yair
Intro puff from HP Marketing
(from product Help folder).

Click play button to start, double-click on


screen for full screen, or download wmv file.

Introduction: Mobile App Types and VuGen Recording Protocols

There are several types of mobile apps and ways to create VuGen scripts for each:

Mobile App Type VuGen Recording Protocol


Pure Web Apps make no reference to hardware Mobile TruClient VuGen protocol records user actions on
components on a mobile device. They run on (client- internet browsers Mozilla Firefox or IE9, not webkit-based
side) internet browsers which users invoke, then Google Chrome or Apple Safari browsers.
specify a URL on web server hosts.

Native Apps written in the programming language Since VuGen is only interested in the load imposed by
native to the device and installed on the device from requests from an app (and not goes on the screen), VuGen
Apple's store or Android Market, then visible as an icon only emulates a mobile device's communication with web
among other apps on the device. servers.

Hybrid apps are installed like native apps (to make it VuGen can invoke an Emulator to generate a script based on
visible in app markets and as an icon on the device) the Emulator's communication with the server. This is done
not just to to display web sites in a thin wrapper with VuGen protocol Mobile App (HTTP/HTML) and
around an internet browser window. Hybrid apps may Recording type "Record emulator".
invoke native hardware capabilities such as GPS, voice
or video recording, barcode scanning, etc. Since there is no emulator on Windows for Apple iPhone and
iPad devices, requests from iOS devices to web servers are
SPA (Single Page Applications) apps make use of captured into a PCAP file using a network sniffer utility
HTML5 storage capabilities to provide off-line such as WireShark, WinPcap, or ltcpdump. PCAP files are
functionality that reduce constant network chatter by imported within Mobile App (HTTP/HTML) scripts' option
referencing resources in its installer or rare downloads. to Recording Wizard > Analyze Traffic .

Mobile Devices
http://www.wilsonmar.com/mobile_vugen.htm 2/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
WARNING: A Physical Device (such as an iPhone or Android) connected via USB to the client VuGen machine is not
supported as of this writing.

VuGen 11 Patch 3+ and up enables recognition of default web browsers on these mobile devices:

Safarai browser on:

iPhone 4
iPhone 3GS
Webkit browser on:
Samsung GT-I9000 (Galaxy S)
RIM BlackBerry 9800 (Torch)
Rim BlackBerry 9650 (Bold)
HP Palm Pre 2.0
Nokia N8-800 (N8)
Nokia 5800d (XpressMusic)
Opera Mobile 10 and Internet Explorer
HTC Desire HD
HTC T9292 (HD7)
HTC HD2

WARNING: Each browser has its own limitations on how well it renders HTML5 and CSS3 (or at all).

HP QTP (Quick Test Pro) / Functional Test

HP's Functional Testing product, which includes QTP plus a product for testing web services, can be used to create
scripts via add-ins that recognize and control mobile devices.

Since QTP controls the UI of the device (above the level where encryption occurs), QTP can be used even if
LoadRUnner cannot figure out the proprietary MDM encryption mechanism between mobile devices and web
servers.

Load Testing Mobile with LoadRunner

Continuing on with a description of the flowchart

On a Windows 7 client machine, VuGen recording settings,


HP VuGen 11 plus Cumulative Patch 3+ DOWNLOAD: LR_03063.EXE is installed to support IE9
on 32 bit Windows 7 Enterprise and Windows Server 2008. Readme (dated May 2011) notes the
patch adds support for
Several options for recording/generating VuGen Scripts run on
HP LR & PC (HP LoadRunner and Performance Center) load generator servers setup with run-time
settings to emulate production loads on remote
Web Servers responding to requests from
mobile apps on mobile devices.

There are several ways to capture communications between a device and web server:

1. Have the device tether to the client Windows machine .same wi-fi network
or
2. In a Mongoose server running the app.

Generating VuGen Mobile TruClient Protocol Scripts

Here are the steps as seen on the video (from 7:55):

1. In VuGen File > New, select the "Mobile TruClient" protocol for recording.
2. Click (the Develop Script button) on the menu bar for the Mobile Settings
pop-up dialog.
3. Select a device. The User Agent string browsers send to servers and the device's window size
appears.
4. Click OK and a Mozilla Firefox window appears along with a script window.

Unlike other recording protocols, a Mozilla Firefox browser is automatically opened, on which
tester actions are recorded, and then generated into scripts which invoke JavaScript functions.

TruClient scripts are hidden behind its own visual interface.

Unlike other recording protocols (such as "Web(HTTP/HTML)") which do not automatically maintain state
(unless correlations are manually coded in), TruClient scripts maintain a separate DOM4 (Document Object
Model) for each vuser, so activities such as OAuth signing is performed automatically, without messy
scripting.

http://www.wilsonmar.com/mobile_vugen.htm 3/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
CAUTION: This requires much more memory on load generators than other protocols for the same number
of Vusers.

WARNING: The internet browser that come with version 11 is IE 7 and Mozilla Firefox 3.6.3.
IE9 and Mozilla Firefox 9 are needed to support HTML5 and CSS3 So web apps that depend on HTML5-capable
Webkit internet browsers, such as Sencha Touch and its KitchenSink demo app need to be recorded using the Mobile
App (HTTP/HTML) VuGen recording protocol described next.

WARNING: Some websites have been coded to "degrade gracefully".

Java for Emulators

Emulators for Android devices run using Java Standard Edition VM.

WARNING: Java options defined for other applications installed on the same Windows instance may interfere with the
emulator's use of Java.

TIP: If you're switching among applications on Windows, consider creating command files to confidently change Java
environment variable settings for each of them.

Emulator Download and Setup

Emulators which enable mobile devices to run under Windows are available for
Download and Install from the internet.

WARNING: Emulators may work within a VM in NAT mode, but not within HP's CAP (cloud) sessions.

As the video says (at 4:03), Apple iPhone and iPad (iOS) devices currently have no emulator running under MS-
Windows OS.

WARNING: Emulators are defined for specific versions of devices. So some emulators may be for obsolete devices.

A. The AVD (Android Virtual Device) emulator.exe installed by the Android SDK installer into folder
tools can be invoked by VuGen.

B. This Stand-Alone Emulator was created during Android 1.5 days.

C. The 57.7MB emulator packaged by Haseeb hosted at addictivetips is an older version (Android 1.5
when version 4.0 is available).

1. Click to download the android-emulator.zip file and unzip to a location such as


C:\temp\Android-Emulator.

2. First make sure it works by running it within a Run Command window, invoke
cd \
cd C:\temp\Android-Emulator
"Run_Emulator(without Boot Animation).exe"

Quotes are needed because of spaces in the program name above.


TIP: To avoid this, replace spaces with underlines in the program name.

A Run Command window should pop-up to display Java options:

D. BlackBerry devices have a different approach than other Android devices.

BlackBerry Playbook tablets require that .APK files be re-packaged into .BAR files. This can be done by an
Eclipse plug-in, on a website, or using a command-line tool. This is necessary to add in code that recognize user
gestures on the touchscreen instead of hardware keys on other Android tablets:

Instead of the Back button, swipe from the bottom of the screen at a 45 degree angle toward
the left side of the screen.
Instead of the Menu button, swipe down from the top of the screen to display the application
menu.
To view notifications, tap the exclamation mark icon in the top-left corner of the home screen.

Requests from business BlackBerry devices travel through the internet and pass the company firewall into a
BlackBerry Enterprise Server running front-end MDS (Mobile Data System) Services which manage traffic
to/from corporate web app servers. So MDS must be setup when running the emulator.

http://www.wilsonmar.com/mobile_vugen.htm 4/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
1. Download BlackBerry's Email and MDS Services Simulator Package
(BlackBerry_Email_MDS_4.1.4.exe) and open (install) it.
2. If the installer doesn't recognize a Java JDK (1.5 or higher), it will ask to download one. But let
it do that only if you really have one installed already. Search for the file folder path to
java.exe, such as C:\PROGRA~1\Java\jdk1.6.0_31\bin or C:\Program
Files\Java\jdk1.6.0_31\bin. Add it to the PATH Windows environment system variable
(separated from other paths by a semicolon). Also add JAVA_HOME Windows environment
system variable
3. Uncheck the JDK, then click Finish for the rest of the MDS install.
4. Open Windows Explorer to where MDS was installed, such as (on a 64-bit machine):
C:\Program Files (x86)\Research In Motion\BlackBerry Email and MDS Services Simulators
4.1.4\MDS\
or C:\Program Files\... on a 32-bit machine. (The version will change with time).
5. Identify if you need to specify a proxy server by looking into Control Panel > Internet Options >
LAN settings.
If a proxy Address is specified (such as if you were within HP offices):
in the config folder, Right-click on file rimpublic.property to Open it (for edit) with Notepad or
other text editor. in the file's [HTTP HANDLER] section, add entries such as :

http.proxyEnabled=True
http.proxyHost = web-proxy.isr.hp.com
http.proxyPort = 8080

6. Invoke MDS services: Open a command Window and invoke run.bat. You may need to Run as
Administrator.
Wait until message "The push service is ready to receive requests" appears.
7. To verify that a screen like this appears, open IE to http://localhost:8080/

One time only, install the BlackBerry device emulator:

1. Download from here a Simulator package for the BlackBerry device being tested (Playbook or
Smartphone such as Torch 9800 for BlackBerry OS version 6.0 as
BlackBerry_Simulators_6.0.0.668_9800.exe (174 MB published 11/15/2011).
2. Open the installer when prompted. The Microsoft C++ 2008 SP1 Redistributable Package is
automatically installed.

Generating Mobile App (HTTP/HTML) Scripts via Emulator

Here are the steps:

1. Close any simulator session still open. Wait for the window to close.
2. In VuGen File > New, select the Mobile App (HTTP/HTML) protocol for recording.

3. To run it within VuGen, click "Start Record" for the


SCREEN: Recording Wizard: Record Emulator - "Record script using a mobile device emulator".

Android Simulator
If using the Android emulator.exe:

For Emulator to record: specify the


location where you saved the HP
ePrint app (as shown on the video
from 2:09)

For Command line: (specified in the


video at 2:22):

@android_v2.2 -http-proxy http://web-proxy.isr.hp.com:8080

TODO: Use a proxy server you setup.

This message can be safely ignored: "emulator: warning: opening audio input failed"

When the emulator screen appears, ensure that settings allow Wi-Fi communication to occur:

1. Click the MENU button.

On first time use, enable within the emulated device HTTP traffic in and out of the emulator:

2. Drag the gray tab up the screen until a screen like this appears.
3. Click the Menu button, click the gray tab near the bottom center of the screen.
4. Click the Settings icon > Wireless controls and uncheck (turn off) Airplane mode.

WARNING: Devices emulated in software can operate quite slowly.

http://www.wilsonmar.com/mobile_vugen.htm 5/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
Remember the port number (such as 5556) displayed on the window's upper right corner.

Click Next for the Recording Wizard: Emulator dialog to specify the Emulator to record as above.

BlackBerry Simulator
If using the BlackBerry emulator fledge.exe:

For Emulator to record: specify the location where the emulator was installed, such as:

C:\Program Files (x86)\Research In Motion\BlackBerry Smartphone Simulators


6.0.0\6.0.0.668 (9800)\fledge.exe

For Command line: specify:

/app=Jvm.dll /app-param=DisableRegistration

To determine what to specify, Run command fledge.exe /? for SCREEN: help GUI.

For Working directory, specify C:\temp.


Click Finish and wai for the Recording... pop-up to begin recording.
Wait for the several minutes it takes the simulator to load. Watch the progress bar.

If the opening disclaimer text appears, drag text up until the SCREEN: OK button appears. Click
OK.
Exercise apps:
Click the (-) Set-up and (-) Personalisation buttons to minimize them.
Click How To > Ask a question online. Click Yes to access URL
http://www.blackberry.com/mobilesupportdocs.
Click the SCREEN: menu button (BlackBerry 7-dot icon). Click the Browser icon.
In the URL text field at top, specify a website such as hp.com.

TIP: Because some emulators do not handle DNS lookups based on host names, browse to a website
by its IP (such as the HP.com landing page at 15.216.110.22).

Sample Apps Recording

Within the simulated device, invoke a mobile app (icon) that generates network traffic (not the Calculator app).

HP ePrint mobile app Business Process

Business process steps shown in the video (at 2:40) for


APP: HP ePrint Android app
BTW, the iOS app is here.

1. Click the HP ePrint icon to invoke the app.


2. click Web.
3. Type www.hp.com, then click the Next button.
4. Type Paris and press the -> button to search.
5. Do not click the first item in the search results.

HP Anywhere ALM Defect mobile app

This has been removed from Android Market.

Windows Client LR/PC Run-time Settings for Emulator scripts

Regardless of emulator device, specify these Recording Wizard settings:

For Traffic data: Capture file: IDEA: Specify a folder other than the default user Documents folder,
and specify a file named with a sortable date/time text such as bb9800_int_pcap_2012.04.01.ET1512
For Filter based on server side: if localhost was used, specify IP 127.0.0.1.

1. [Screen] Within VuGen Run-time Settings > Network > Speed Emulation,
2. Select "Use a standard bandwidth" and
3. Select from the drop-down "85/40 (GPRS - max)".

Capturing PCAP File via Wi-Fi Tethering of Physical Device

This approach establishes an ad hoc network by making


use of built-in facilities on Windows 7 client machine and How to create Ad-Hoc Connection
mobile devices (or any computer) @ Windows 7

Windows 7 or Windows 2008 R2 machines have Wireless Hosted TOOL: SoftAP (Software-enabled Access
Network (Virtual Wifi) technology. Point) which this Wikipedia article calls
Windows Vista has ad hoc network Wifi Hot Spot. tethering.

http://www.wilsonmar.com/mobile_vugen.htm 6/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
This requires Administrator permissions on your Windows TOOL: connectify.me changes a Win7
client machine. machine to a WIFI router.

1. On a machine hard wired to the internet, from TOOL: Virtual Router Project on CodePlex is a
Windows Start > Connect to free, open source Wireless Hosted Network
2. Click "Set up a connection or network" (on the lower implementation written in C#.
left corner)
TOOL: SeventhGate for Windows 7 and
3. Double-click "Set up an ad hoc (computer-to-
Server 2008R2 is a lightweight open-source
computer) network" (the 4th item on the list) alternative to VirtualRouter.
4. Click Next to acknowledge that computers must be
within 30 feet of each other (or closer).
5. Define a Network name (such as "Mobiletest")
6. Select "No Authentication (open)" or other type requiring a password.
7. Click "Save this network" and Next.
8. Wait for the "network is ready for use" message, then Close.

9. On an Android mobile device, enter menu Settings > Wireless and network > Wi-Fi settings.
10. Scroll to the bottom and select "Add Wi-Fi network"
11. Enter the network name just created (Mobiletest) and Save.

devices connected to a Direct Wi-Fi network. The Samsung Galaxy SII support this. But some other
versions of Android do not support this approach.

1. Enable Wi-Fi Direct under Settings > Wireless and Network.


2. Configure Wi-Fi Direct under Settings > Wireless and Network.

Proceed to Capturing Requests to a PCAP File

Capturing a PCAP File within Android Devices

TOOL: tcpdump is the Unix alternative to WinPcap.

Since Android has tcpdump by default, run from the device's Linux OS command line, which requires the device to be
rooted.

1. WARNING: Make sure there is enough SDcard specified on the emulator for the capture anticipated.

2. Set arbitrary filters and options for tcpdump:


adb -e shell tcpdump -s 0 -w /sdcard/capture.pcap host 10.0.2.2

"-s 0" specifies capture of packets without truncating their data.

3. Take the app through its paces (business processes):


adb pull /sdcard/capture.pcap

4. Transfer the PCAP file to the VuGen Windows machine.

Proceed to Generate VuGen Script From a PCAP File

Capturing a PCAP File in a Modified Remote Web Server

In order to record ALL traffic (both Wi-Fi and cellular network traffic), install software on the remote web server
so that requests from devices are captured before being passed to the real web server.

CAUTION: In enterprise IT shops, the following is done by trusted system administrators with administrative
permissions.

Instructions for a Windows server are below.


Instructions for a Linux server are here

Mongoose on Microsoft Web Servers

1. LR 11 Patch 3+ installs to folder C:\Program


Files\HP\LoadRunner\mobileRemoteAgent\win32 files mongoose-2.11.exe and capture.cgi.

You could download file more recent mongoose-


3.x.exe to that folder. But they have not been Mongoose (at http://code.google.com/
tested. p/mongoose/) is a cross-browser
embedded server released under MIT
2. Copy an installer of Wireshark to that folder. license
3. Zip that Win32 folder into a zip file.
4. Copy the zip file to the remote folder.
5. Expand the zip to a folder such as "C:\RemoteSniffer".
http://www.wilsonmar.com/mobile_vugen.htm 7/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
6. In a folder on the server's Windows PATH (such as C:\Windows) a Cmd file to issue these
commands:
cd \
cd C:\RemoteSniffer
mongoose-2.11.exe -e errorLog.txt -r "C:\RemoteSniffer" -C ".cgi" -p 1080

-e errorLog.txt specifies the name of the error log.

-C ".cgi" specifies that the server invokes cgi files such as MobileCGI.cgi in the "cgi-bin" folder (based on
the mobileCGI.conf file controlling it).

-p 1080 specifies the listening port. Change this to the actual one..

A full list of parameters is at http://code.google.com/p/mongoose/w/list

7. Verify whether the above invoked the


Mongoose service. Right-click on the
Windows date/time. Select Task Manager.
Click Processes. Click on Name to sort. Press
M.

8. Open a browser to start recording with this


URL:
http://localhost:1080/cgi-bin/mobileCGI.cgi?STARTRECORD

The CGI program opens the WinPCAP program and begins recording.

9. Invoke the application under test.

For example, if you want to use the web server that comes with LoadRunner:

Windows Start > All Programs > HP LoadRunner > Samples > Web > Start Web Server

Windows Start > All Programs > HP LoadRunner > Samples > Web > HP Web Tours APplications
opens a browser session to:
http://127.0.0.1:1080/WebTours/
go to this from a tethered phone.

10. Use browser to stop recording with this URL:


http://localhost:1080/cgi-bin/mobileCGI.cgi?STOPRECORD

This stops recording and the OS prompts for a location to save the resulting PCAP file.

Proceed to Generate VuGen Script From a PCAP File

Linux Web Servers

folder LinuxRH3

CGI (Common Gateway Interface)

CGI files are unreadable using text editors because it was compressed into a format that cannot be read by
people.

CGI files are written in the Perl or C programming language.

Capturing Requests to a PCAP File on VuGen Client

Downloading Software
TOOL: For Windows machines, Wireshark, is a Windows TIP: The complexity of
GUI which makes use of WinPCap (Windows Packet WireShark makes it
Capture). necessary to spend a few
bucks for some instruction
WIKIPEDIA notes wireshark evolved from Ethereal in addition to visiting the
developed by Gerald Combs after his previous employers Q&A forum and Wiki.
demanded rights to his work on Ethereal even though it
was done after hours. He then led a team which Sample files in the Supplements section of
developed WireShark.org. YOUTUBE: See him talk live at the Wiresharkbook website.
Sharkfest 2013, UC Berkeley, CA. June 2013.
Laura Chapell is the queen geek user on
WireShark.
The simplest approach is use what comes with
LoadRunner in "Additional Components" folder on the
http://www.wilsonmar.com/mobile_vugen.htm 8/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
LR install DVD folder. It require invocation of a Run Certification exams are part of the ecosystem
command window and typing out commands required to around Wireshark.
invoke it.
Most tutorials are focused on security rather
CAUTION: Avoid downloading the latest version from than performance:
Wireshark.org, not wireshark.com). LoadRunner was NOT
YOUTUBE: Introduction to Wireshark install
tested with Wireshark 1.8+ which defaults to the pcapng
of v0.99.8. Analyzing Wireshark Logs 1, 2, 3
format LoadRunner 11.52 doesn't recognize. Older
by Aniket Amdekar
versions of Cascade Pilot, Snort, and tcpdump don't (aniket_zpm@yahoo.com).
either.

DOWNLOAD: wireshark-win64-1.6.8.exe from


https://www.wireshark.org/download/win64/all-versions

Before Wireshark Usage


A lot of traffic goes through network cables. So several
steps need to be taken to ensure that only what is
applicable to the area of interest is captured.

1. Disable services that periodically sychronize data


automatically, such as Dropbox, Evernote, Outlook
holidays.ics, etc.

2. Identify the Destination IP address (such as


72.12.32.121) for the web server under test: Start
a Run command window and ping the host name,
such as:
ping www.httprecipes.com

This site provides samples for readers of Jeff


Heaton's book HTTP Programming Recipes for C#
and Java.

3. Get your mobile device on the same network as your laptop, so your laptop can capture the mobile
device's network traffic.

4. Start Connectify or Windows Internet Connection Sharing.


YOUTUBE: Intro to Connectify by Alex

5. WARNING: Don't start the app under test until WireShark is recording, since requests may made
through the network as part of app start-up.
6. Initiate the WireShark.exe program.

Wireshark Default Configuration Overrride

1. Click the left-most icon to configure Capture pcapng.com can receive a PcapNG file
Interfaces. (of up to 8 MB) and convert it to PCAP
2. Check the interface with Packets being updated. format.
3. Click the Options button.
4. Uncheck "Use pcap-ng format" since LoadRunner Alternately, use this Unix command:
11.52 doesn't yet recognize the extra metadata
tcpdump -r file.pcapng -w file.pcap
added by pcap-ng.
5. If you are to record activities on your PC, uncheck
"Use promiscuous mode on all interfaces".
If you are to record activities on a mobile device,
check "Use promiscuous mode on all interfaces".

6.
On the WireShark menu, select Edit, Preferences.
7.
Unclick "Enable transport name resolution" YOUTUBE: How to setup Wireshark for
8.
Click User Interface | Columns. optimal troubleshooting by Hansung Bae
9.
Click Add. For Title, enter "Delta" and select Field at Riverbed focuses on amount of data
Type "...". transferred over periods of time.
10. Click Add. For Title, enter "CumByte" and select
Field Type "Cumulative Bytes".
11. Click Add. For Title, enter "UTC" and select Field Type "UTC Date and Time".

12. To get packets listed, click the Start button or press Ctrl+E to toggle between start/stop recording.
13. Click the red square button on the toolbar to stop recording.
14. Click on a packet displays the bytes in a lower pane.
15. Click the zoom in or zoom out icons to make fonts smallers or larger.

http://www.wilsonmar.com/mobile_vugen.htm 9/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com

Wireshark Filter Configuration


1. On the toolbar, click Analyze and scroll down to click
HTTP. This inserts "http" in the Filter field.
WireShark is designed to show everything
2. Click on one of the HTTP lines.
that goes across the wire. HTTP sent from a
3. In the Filter: field, type ip.addr == followed by the ip
browser is sent as application layer through
address to your app's web server identified before. by lower level TCP packets within Ethernet.
The edit box background should turn green.
4. Create a button for the filter by pressing Save. TIP: Wiresharks filtering tutorial
Use a short name.
Winpcaps Filtering expression syntax, such
Wireshark Columns Configuration as http.host matches "[.](cn|ru)$" for TLD
from China or Russia.
1. Click on one of the HTTP lines.
2. On the bottom panel, click to expand "Frame"
section.

3. On the bottom panel, right-click on "Time delta from previous captured frame".
4. Select "Apply as Column".
5. Drag the column heading and drop it near the other Time column ("Time since reference or first
frame")

6. NOTE: The "Length" column is "Capture Length" in the Frame section.

Wireshark Usage

1. Start the mobile app under test and navigate to right before where it begins to make requests
through the network and to its web server.
2. Click "Capture" and invoke the app under test.
3. Run your app through its business processes.
4. Click the Stop button.
5. Save As default file type Wireshark/tcpdump/... - libpcap (*.pcap,*.cap) even though there are
others.

Batch Processing Pcap Logs

If you created a Pcap file using WireShark, proceed to


Importing a PCAP File to Generate VuGen Script

But before you do, you may want to reduce large PCap files.

Batch processing large files after opening a command line console to type in and execute:

tshark on Windows machines, regular express parameters need to be within double sets of quotes such as this:

> tshark -r monsterfile.pcap -R "http.host matches ""(?!)[.](ru|cn)$""" -w dns.pcap (where -R is the filter).

SSL Taffic
Traffic with websites using HTTPS URLs are seen in
WireShark protocol "SSLv3" (Secure Socket Layer version YOUTUBE: Understanding Encryption
3) or "TLSv1.2" (Transport Link Security version 1.2) Services Using Wireshark by Larry
rather than "HTTP". Greenblatt,
WireShark SSL Decryption and this show
If you use protocol HTTPS to access a website to analyze, how.
you need to supply WireShark with the site's SSL
certificate, which is usually owned by IT Operations
Security personnel. They need to create a file like file snakeoil2_070531.tgz downloaded from web page
wiki.wireshark.org/SSL

A sample certificate can be obtained from

On the WireShark menu, select Edit, Preferences.


Click the [+] in front of Protocols, press S several times for SSL.

http://www.wilsonmar.com/mobile_vugen.htm 10/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com

rpcapd.exe

WARNING: WinPcap needs to be started before lrtcpdump.

1. After running the installer, open a Run Command window. CD to Program Files/WinPcap, and invoke
program rpcapd.exe.

2. Open another Run Command window.

3. Optionally, list network interface addresses:


route PRINT 0.0.0.0

4. cd to "C:\Program Files\HP \LoadRunner\bin" folder where the during LoadRunner installation


installed the
5. lrtcpdump utility, derived from Unix tcpdump. You can choose to analyze the client side traffic and
define the IP address of the client. This way, only events from the client's IP address are included in
the script VuGen generates

TIP: Use file suffix of ".cap".

lrtcpdump -f whatever.cap

Since no interface is specified, the response should be something like this:

Select Interface to Capture:


1)\Device\NPF_{E8BBCA8F-12FF-418E-BE04-5AD12F57F2F4} - Sun
2)\Device\NPF_{C53B077C-6E71-479F-B4F9-A9C49D3A6A9C} - Intel(R) 82577LM Gigabit Network Connection
3)\Device\NPF_{B58E33D8-EC9B-4286-88F4-88780F54567D} - Microsoft
4)\Device\NPF_{970C1394-D6FD-4160-9747-1F55E46C3A72} - VMware Virtual Ethernet Adapter
5)\Device\NPF_{079165EE-198E-4A19-8A56-5CE06045BB43} - VMware Virtual Ethernet Adapter
Enter Your Choice:

For example, type 2 for the number associated with the Emulator or Network Connection. Leave the window
running with the resulting message:

Capturing ...(press enter to stop)

6. Go through the list of actions on the mobile device being tested.

REMEMBER: For server load emulation, we are only interested in emulating requests to the
server, not every user action (as during functional testing).

7. Press Ctrl-C after all actions have been performed.

NOTE: The PCAP file generated is not human-readable.

8. Transfer files to the VuGen Windows machine.

Proceed to Generate VuGen Script From a PCAP File

Generate VuGen Script From a PCAP File

Here are the steps:


VuGen Web Services recording protocol
1. Open Vugen. Select "Mobile App (HTTP/HTML)" can also import PCAP files to generate
protocol. scripts.
2. Click Start Recording.
3. Click Recording Wizard > Analyze Traffic
4. Browse to the PCAP file location to be used to generate a script.
5. Specify the IP address of either the host or the client, observed during PCAP recording>.

http://www.wilsonmar.com/mobile_vugen.htm 11/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
WARNING: No file is generated if the IP address specified here does not match what is in the file.

If you've forgotten what the IP addresses are, use a PCAP file reader utility to view the file.

6. Click OK for VuGen to perform an import and generate the script for use by LoadRunner or
Performance Center.

Modify Scripted Requests to the Actual Pattern of Requests

After generating a script,

1. Change Run-time setting > Proxy > "Obtain Proxy settings from default browser".

2. Insert Think time between transactions.

3. Review the pattern of calls, perhaps with Shunra's tool, which analyzes PCAP files in depth.

Upload your PCAP file on-line to:


TOOL: PCAP Web Performance Analyzer

A major source of load (and thus performance issues with mobile apps) may need to be emulated by a loop
coded within VuGen scripts (run by perhaps a separate scenario group) to perform periodic polling of the server
to see if there are more recent updates. Each older internet web browser must regularly do this perhaps every
few seconds.

HTML5 web apps and Adobe Flash apps enable Push Notifications so clients (devices) can quietly wait for
updates from servers.

Network Monitoring

Network Monitoring enables separation of time spent by the carrier network rather.

Differences in timing among different devices can also be captured by HP's BSM software.

Other Mobile Perf Test Tools

Why doesn't mobile-boilerplate/wiki/Mobile-Performance-Tools mention LoadRunner?

TOOL: jdrop.org stores large amounts of performance data (in JSON format) sent from mobile devices to enable
analysis of HTTP waterfall charts, HTTP headers, document source, etc. remotely on a larger desktop screen.

TOOL: Network Miner reads from the wire or imports from .pcap files.

http://www.wilsonmar.com/mobile_vugen.htm 12/12