Professional Documents
Culture Documents
com
Topics this page:
Flowchart
Mobile VuGen Summary: App
Site Map
http://www.wilsonmar.com/mobile_vugen.htm 1/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
There are several types of mobile apps and ways to create VuGen scripts for each:
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:
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'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.
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.
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.
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.
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.
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.
C. The 57.7MB emulator packaged by Haseeb hosted at addictivetips is an older version (Android 1.5
when version 4.0 is available).
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"
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/
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.
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.
Android Simulator
If using the Android emulator.exe:
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:
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.
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:
/app=Jvm.dll /app-param=DisableRegistration
To determine what to specify, Run command fledge.exe /? for SCREEN: help GUI.
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).
Within the simulated device, invoke a mobile app (icon) that generates network traffic (not the Calculator app).
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)".
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.
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.
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.
-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..
The CGI program opens the WinPCAP program and begins recording.
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.
This stops recording and the OS prompts for a location to save the resulting PCAP file.
folder LinuxRH3
CGI files are unreadable using text editors because it was compressed into a format that cannot be read by
people.
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.
3. Get your mobile device on the same network as your laptop, so your laptop can capture the mobile
device's network traffic.
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.
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
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")
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.
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
http://www.wilsonmar.com/mobile_vugen.htm 10/12
04/08/2017 Mobile VuGen Scripting :: WilsonMar.com
rpcapd.exe
1. After running the installer, open a Run Command window. CD to Program Files/WinPcap, and invoke
program rpcapd.exe.
lrtcpdump -f whatever.cap
For example, type 2 for the number associated with the Emulator or Network Connection. Leave the window
running with the resulting message:
REMEMBER: For server load emulation, we are only interested in emulating requests to the
server, not every user action (as during functional testing).
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.
1. Change Run-time setting > Proxy > "Obtain Proxy settings from default browser".
3. Review the pattern of calls, perhaps with Shunra's tool, which analyzes PCAP files in depth.
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.
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