520 likes | 540 Views
Dive deep into the world of mobile app performance testing to uncover possible points of risk and optimize network, backend, and device interactions for better user experience and brand reputation. Learn from HP LoadRunner components and workflow to elevate your mobile testing game.
E N D
Introduction to Mobile Performance Testing Wilson Mar, Angel Tran, Shlomi SalmaHOL330 in Sands 305, June 13, 2013
Why performance test mobile apps? Mobile apps arenow: • how customers locate stores and information • how brands get exposure many times a day • the “face” of the organization
Baseline vs. impact of network latency, etc. from HP Network Virtualization by Shunra [P01]
Possible points of risk in landscape mDev: Network: Network: Network: Dev: SysAdmin: Back-end: DBA: Load Bal. Algorithm Latency& Loss ResourceUsage Server Config. Pooling &Threading DB Indexes & Logs DataCaching Encrypt, Compress. 3rd Party Cloud Services Platforms& Versions 2G,3G,4GCellular FirewallsVPNs WebServers AppServers DB Servers Storage LoadBalancers Device Features ISPs ScreenSizes Carriers InternetBrowsers Mobile Components LANs Web Services CDNs & CoLo.
HP LoadRunner components and workflow Application Server(s) Database End User Client(s) Internet/WAN 5 Virtualize Network 1 Author Scripts 7 4 6 Measure Impact Virtualize Services Generate Load 8 Analyze, Compare, Report HP Live Network Test Scenario 2 Collaborate Plan and Execute Tests 3
Scan for more information ServiceVirtualization MobileTesting http://www.hp.com/go/... LoadRunner NetworkVirtualization HP Codescan app
Mobile technology terms Android WindowsPC “featurephones” iPhone, iPad Play. google.com Apple App Store Hybridapp internetexplorer minimalbrowser Chromebrowser Safari browser URL URL URL Native app ft.com HTML4 m.ft.com mobile site ft.com HTML5 responsive design ft.com/ws web services
Mobile LoadRunner Scripting Demos https://connections.houston.hp.com/docs/DOC-15086
Android Screen Monitor http://code.google.com/p/android-screen-monitor/ • Download to folder …\sdk\platform-tools\ASM.jar • Within Windows Explorer, double click on ASM.jar
Create a New Script, Mobile Category HP LoadRunner VuGen 11.5 SP1+
Multiple Approaches Available • Browser or hybrid app: • Ajax? > TruClient Ajax Mobile scripting protocol using User Agent spoofing in Firefox • Simple > Mobile HTTP/HTML scripting protocol • Native app: > Mobile HTTP/HTML scripting protocol • Android: • No device > Record Emulator using Android Virtual Device (AVD) • Have rooted device > Mobile Recorder generate lrpcap to Analyze • iOS & others: • > LoadRunner Proxy on same subnet/Wi-Fi hub (the newest technique) • > Record & AnalyzeWinPcap capture on the mobile app server
Recording Method TruClient Ajax App web server User Agent in Firefox > TruClient Ajax HP LoadRunner VuGen 11.51+
TruClient recording HP LoadRunner VuGen 11.51+
Devices with User Agent strings Count: 27 HP LoadRunner VuGen11.52
User Agent string example Sample User Agent for Samsung Galaxy S3 Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 More at http://www.useragentstring.com/ HP LoadRunner VuGen11.52
Android Versions 4.1 (16) 4.2 (17) 4.0 (15) 2.3 (9,10)
VuGen Scripting Process • Configure recording settings • Consider run-time settings • Object identification using script levels • Specify Transaction Names • Specify Completion End Events Logic • Insert flow control • Run-time logic • Vary data based on parameters • Using C script functions in a library from HP Virtual User Generator User Guide 11.52 page 73
Random Think-time in TruClient Arguments: Math.floor( 11 * Math.random()+5 ); http://www.perftesting.co.uk/ajax-truclient-tips-and-tricks-part-ii/2012/05/02/
TruClient Toolbox drag and drop Arguments: var randWait = Math.floor( 11 * Math.random()+5 ); window.alert( “randWait=” + randWait ); http://www.perftesting.co.uk/ajax-truclient-tips-and-tricks-part-ii/2012/05/02/
HTTP/HTML Mobile Recording https://connections.houston.hp.com/docs/DOC-15086
Mobile HTTP vs. HTML mode=“HTTP” mode=“HTML” For use with web services calls. Does not parse for resource requests. Parse HTML to automatically identify additional resources to download • CSS • JavaScript HP LoadRunner VuGen
Record Mobile HTTP/HTML HP LoadRunner VuGen11.52
HTTP/HTML Recording Methods Wizard HTTP/HTML Record & Analyze Traffic Analyze Traffic Record Emulator Proxy Recording TruClient HP LoadRunner VuGen11.52
Proxy Recording https://connections.houston.hp.com/docs/DOC-15086
HTTP/HTML Recording Methods Wizard HTTP/HTML Proxy Recording TruClient HP LoadRunner VuGen11.52
Proxy Recording HTTP/HTML Android APK iOS App web server IPA VuGen Proxy IP:Port 8080 LoadRunner Proxy Proxy Recording Port 80/443 HP LoadRunner VuGen11.5x
Proxy Recording HTTP/HTML Proxy Recording HP LoadRunner VuGen11.52
Proxy Recording Setup on iOS 1. 2. 3. Scroll down 4. 255.255.255.0 192.168.1.2 Eleanor 192.168.1.1 Eleanor 192.168.1.3 8080 Password: ncjm-q3ey-t1dd Source: http://www.amsys.co.uk/2012/blog/how-to-setup-proxy-servers-in-ios/
Proxy Recording Setup on Android Galaxy S3 (4.1.2) 1. 2. Long press 3. 4. Eleanor ncjm-q3ey-t1dd
Record Emulator https://connections.houston.hp.com/docs/DOC-15086
HTTP/HTML Recording Methods Wizard HTTP/HTML Record Emulator HP LoadRunner VuGen11.52
Record Emulator Android Recording Method HTTP/HTML Android Play.Google .com Install APK Backup File manager Copy Android… \sdk\tools APK Record Emulator deviceemulator Async. @device ADT file App web server HP LoadRunner VuGen11.5x
Record Emulator Requirements HTTP/HTML USB cable to device USB driver for device Android app APK file for Android app under test Android file download manager app to extract APK file from device JDK (Java Development Kit) ADT (Android Development Toolkit) plug-in for Eclipse AVD (Android Virtual Device) within Eclipse for device under test JAVA_HOME and PATH Windows environment variables HP LoadRunner 11.50 and SP2 patch to upgrade to 11.52 Record Emulator
Record & Analyze Traffic https://connections.houston.hp.com/docs/DOC-15086
HTTP/HTML Recording Methods Wizard HTTP/HTML Record & Analyze Traffic HP LoadRunner VuGen11.52
Record & Analyze Traffic HTTP/HTML Android .cap, .pcap Record & Analyze Traffic networksniffer APK Ad hoc network iOS App web server IPA HP LoadRunner VuGen11.5x
Analyze Traffic https://connections.houston.hp.com/docs/DOC-15086
HTTP/HTML Recording Methods Wizard HTTP/HTML Analyze Traffic HP LoadRunner VuGen11.52
Analyze Traffic HTTP/HTML Android 4.1+(rooted) Android Mobile Recorder APK Analyze Traffic .lrpcap App web server HP LoadRunner VuGen11.52
Android Mobile Recorder 1. Start Recording 2. Perform user steps. 3. Stop and send email
Recording Methods Recap HTTP/HTML Android 4.1+(rooted) Android Record & Analyze Traffic Play.Google .com .cap, .pcap networksniffer Mobile Recorder APK Analyze Traffic .lrpcap Ad hoc network APK Record Emulator deviceemulator @device ADT file iOS App web server IPA VuGenProxy IP:Port 8080 Proxy Recording LoadRunner Proxy Port 80/443 User Agent in Firefox > TruClient Ajax HP LoadRunner VuGen11.52
Mobile scenarios https://connections.houston.hp.com/docs/DOC-15086
How can we help? Development Execute automated build Analytics Agile Manager (Jenkins) Executive Scorecard App. Lifecycle Intelligence Security Code Scan Fortify Source Code Analysis Test results Performance Center ALM Analysis Tear down environment Provision & deploy environment Continuous Delivery Automation (CDA) Continuous Delivery Automation (CDA) Application Security Assessment WebInspect Monitoring & Diagnostics Run test cases Business Service Management Service Virtualization UFT / BPTLoadRunner ALM Lab Management Network Virtualization HP integrated testing suite
Interconnected component services Shopping process • Buy • Ship • Track • Search • Pay Product Customer profiles Payment Shipping Traditional Composite Track package Managed cloud Public cloud Privatecloud
Concurrency and rendezvous Illustrative data [P10]
Key take-aways • For mobile browser apps (jQuery Mobile, Sencha, PhoneGap, etc.), little scripting is needed using User Agent spoofing via Firefox TruClient Mobile • JavaScript executes against a DOM for each virtual user • Traffic captured between native apps and server are converted to VuGen scripts • Android native app traffic on rooted devices can be recorded on device using LoadRunner Mobile Recorder • iPhone and iPad (iOS) -- all non-rooted apps – can be recorded using LoadRunner Proxy • Monitor and Diagnose using HP Business Service Management • Consider HP Network Virtualization and Services Virtualization