Introduction to Mobile Performance Testing

45  Download (0)

Full text

(1)

Introduction to Mobile

Performance Testing

Shlomi Zalma, Wilson Mar

DT3338 at Noon, June 13, 2013

HOL330 in Sands 305

(2)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Mobile apps are now:

Why performance test mobile apps?

• how customers locate stores and information

• how brands get exposure many times a day

• the “face” of the organization

(3)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

(4)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. 5

Baseline vs. impact of network latency, etc.

[P01]

from HP Network Virtualization by Shunra

(5)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Possible points of risk in landscape

Storage

DB

Servers

App

Servers

Web

Servers

Load

Balancers

3

rd

Party

Cloud Services

CDNs & CoLo.

Carriers

Internet

Browsers

Platforms

& Versions

Firewalls

VPNs

Device Features

2G,3G,4G

Cellular

Mobile

Components

Screen

Sizes

Web

Services

LANs

ISPs

DB Indexes

& Logs

Resource

Usage

Latency

& Loss

Pooling &

Threading

Server

Config.

SysAdmin:

Back-end:

DBA:

Dev:

Network:

Data

Caching

mDev:

Encrypt,

Compress.

Load Bal.

Algorithm

Network:

Network:

(6)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

HP Live

Network

Collaborate

2

HP LoadRunner components and workflow

Virtualize Network

5

End User

Internet/WAN

Application Server(s)

Database

Analyze, Compare, Report

8

Client(s)

Generate Load

6

Author Scripts

1

Measure Impact

7

Test

Scenario

Plan and Execute Tests

3

Virtualize Services

(7)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Scan for more information

LoadRunner

Network

Virtualization

Service

Virtualization

Mobile

Testing

HP Codescan app

http://www.hp.com/go/...

(8)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Apple

App

Store

Play.

google

.com

iPhone, iPad

Android

“feature

phones”

Windows

PC

Mobile technology terms

Safari

browser

URL

m.ft.com

mobile

site

ft.com/ws

web

services

ft.com

HTML5

responsive design

Native

app

internet

explorer

ft.com

HTML4

URL

minimal

browser

URL

Hybrid

app

Chrome

browser

(9)

Mobile LoadRunner Scripting

(10)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Create a New Script, Mobile Category

(11)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

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 & Analyze WinPcap capture on the mobile app server

(12)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Recording Method TruClient Ajax

TruClient Ajax

HP LoadRunner VuGen 11.51+

App web server

User Agent

in Firefox >

(13)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

TruClient recording

(14)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Devices with User Agent strings

Count: 27

(15)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Sample User Agent for Samsung Galaxy S3

User Agent string example

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

HP LoadRunner VuGen11.52

More at

http://www.useragentstring.com/

(16)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Android Versions

4.1 (16)

4.2 (17)

2.3 (9,10)

4.0 (15)

(17)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

(18)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

VuGen Scripting Process

from HP Virtual User Generator User Guide 11.52 page 73

1.

Configure recording settings

2.

Consider run-time settings

3.

Object identification using script levels

4.

Specify Transaction Names

5.

Specify Completion End Events Logic

6.

Insert flow control

7.

Run-time logic

8.

Vary data based on parameters

(19)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Random Think-time in TruClient

Arguments:

http://www.perftesting.co.uk/ajax-truclient-tips-and-tricks-part-ii/2012/05/02/

(20)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

TruClient Toolbox drag and drop

window.alert( “randWait=” + randWait );

Arguments:

http://www.perftesting.co.uk/ajax-truclient-tips-and-tricks-part-ii/2012/05/02/

Math.floor( 11 * Math.random()+5 );

var randWait =

(21)

HTTP/HTML Mobile Recording

(22)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Mobile HTTP vs. HTML

HP LoadRunner VuGen

mode=“HTML”

mode=“HTTP”

Parse HTML to automatically

identify additional resources to

download

For use with web services calls.

Does not parse for resource requests.

• CSS

(23)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Record Mobile HTTP/HTML

(24)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

HTTP/HTML

TruClient

HTTP/HTML Recording Methods Wizard

Proxy

Recording

Record

Emulator

Analyze

Traffic

Record &

Analyze

Traffic

HP LoadRunner VuGen11.52

(25)

Proxy Recording

(26)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Proxy Recording

Android

LoadRunner

Proxy

HTTP/HTML

Proxy

Recording

HP LoadRunner VuGen11.5x

App web server

Port 80/443

Proxy

Port 8080

APK

(27)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Same subnet via Wi-Fi router

HTTP/HTML

Ethernet cables

Wi-Fi router

on private LAN

Proxy

Recording

(28)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Proxy Recording

HP LoadRunner VuGen11.52

HTTP/HTML

Proxy

Recording

(29)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Proxy Recording Setup on iOS

1.

Source: http://www.amsys.co.uk/2012/blog/how-to-setup-proxy-servers-in-ios/

4.

3. Scroll down

2.

Eleanor

Password:

ncjm-q3ey-t1dd

Eleanor

192.168.1.2

255.255.255.0

192.168.1.1

192.168.1.3

8080

(30)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Proxy Recording Setup on Android Galaxy S3 (4.1.2)

(31)

Record Emulator

(32)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Record Emulator Android Recording Method

Android

device

emulator

HTTP/HTML

Record

Emulator

APK

HP LoadRunner VuGen11.5x

App web server

Async.

APK

@device ADT file

Android… \sdk\tools

File

manager

Backup

Play.

Google

.com

Install

Copy

(33)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Record Emulator Requirements

1. USB cable to device

2. USB driver for device

3. Android app APK file for Android app under test

4. Android file download manager app to extract APK file from device

5. JDK (Java Development Kit)

6. ADT (Android Development Toolkit) plug-in for Eclipse

7. AVD (Android Virtual Device) within Eclipse for device under test

8. JAVA_HOME and PATH Windows environment variables

9. HP LoadRunner 11.50 and SP2 patch to upgrade to 11.52

HTTP/HTML

Record

Emulator

(34)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Record & Analyze Traffic

Android

network

sniffer

iOS

HTTP/HTML

Record &

Analyze

Traffic

Ad hoc network

.cap,

.pcap

HP LoadRunner VuGen11.5x

App web server

APK

(35)

Analyze Traffic

(36)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Analyze Traffic

Mobile

Recorder

Android

.lrpcap

HTTP/HTML

Analyze

Traffic

Android 4.1+

(rooted)

App web server

HP LoadRunner VuGen11.52

(37)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Android Mobile Recorder

1. Start Recording

2.

3. Stop and send email

Perform

user

steps.

(38)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

(39)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Recording Methods Recap

Mobile

Recorder

Android

.lrpcap

LoadRunner

Proxy

device

emulator

network

sniffer

iOS

Proxy

Port 8080

HTTP/HTML

Proxy

Recording

Record

Emulator

Analyze

Traffic

Record &

Analyze

Traffic

Port 80/443

User Agent

in Firefox >

Android 4.1+

(rooted)

Ad hoc network

APK

APK

.cap,

.pcap

TruClient Ajax

HP LoadRunner VuGen11.52

App web server

@device ADT file

IPA

Play.

Google

(40)

Mobile scenarios

(41)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

How can we help?

Run

test cases

Provision & deploy environment

Execute automated build

Application Security Assessment

Test results

Security Code Scan

Fortify Source Code Analysis

UFT / BPT

LoadRunner

WebInspect

Continuous Delivery Automation (CDA)

(Jenkins)

HP integrated testing suite

ALM Analysis

Executive Scorecard

Performance

Center

Service Virtualization

Network Virtualization

Development

Agile Manager

Business Service Management

Monitoring & Diagnostics

Analytics

App. Lifecycle Intelligence

ALM Lab Management

Tear down environment

(42)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Shopping process

Interconnected component services

Pay

Buy

Ship

Track

Product

Search

Customer profiles

Payment

Shipping

Composite

Managed

cloud

Public

cloud

Traditional

Track package

Private

cloud

(43)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. 44

Concurrency and rendezvous

[P10]

Illustrative data

(44)

© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

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

(45)

Figure

Updating...

References

Related subjects :