Record Android apps with HP LoadRunner Vugen

Source: Internet
Author: User
Tags netspeed hp loadrunner

Richard Pal from: perftesting translation: Elaine00

In this article, I'll show you how to test the network traffic for an Android app with HP LoadRunner Vugen. During the test, the Android SDK will be used to execute the Android app, while the HP LoadRunner Vugen will be used to capture the package and convert it to the HP LoadRunner Vugen script.

Requirements:

    • Loadrunner/performance Center Virtual User Generator 9.5x
    • Android SDK with the Android emulator
    • A Test Application

First, prepare the Android simulator:

First, you need to download the Android SDK first, after extracting sdk.zip, click SDK Manager.exe to configure the update, download the various necessary APIs.

This will take a certain amount of time. After the configuration is complete, create an Android emulator, such as creating a simulator named A22,android version 2.2.

Configure a new Android virtual image to install our Android app.

Need to prepare the application to be tested before testing get the application under test ready

Prepare the APK installation package that you want to install first.

Here we use the Android SDK Wikipedia example to show.

Deploy Android apps to simulator Deploy the Android application into the emulator

Launch the emulator, either via the SDK Manager's user interface or via the command line (set the analog name to A22).

D:\APPS\ANDROID-SDK-WINDOWS\TOOLS\EMULATOR.EXE-AVD a22-netspeed Full-netdelay None ~/.android/a22.avd

[UPDATE] because I wrote the argument list of the emulator in this article has changed. Now you need to give the "DeviceName Emulator.exe simulator configuration, for example emulator.exe @ A22based."

Once the device has finished booting, use the ADB tool to install the Android app into the Android SDK (you need to switch to the directory where the apk is stored ):

D:\APPS\ANDROID-SDK-WINDOWS\PLATFORM-TOOLS\ADB Install wiktionary.apk

Launch the app in the emulator, and you need to make sure that the app is performing properly.

Use Vugen to crawl network packets generated by Android applications

Close the emulator.

Create a new script because Wiktionary uses HTTP and JSON, so the HTTP protocol will be used.

In the dialog that starts recording, you need to specify some execution parameters for the emulator and the virtual emulator that are executed:

    • Program to Record: D:\apps\android-sdk-windows\tools\emulator.exe
    • Program arguments: -avd a22-netspeed full-netdelay None (see the [Update] on argument list above)

(Make sure to change the simulator name to A22.) )

Before you start recording, the capture level of the network needs to be modified to: "Socket level and WinInet level data". (The other two options are do not record any traffic or crash the emulator during recording)

Add "Application/json" to Non-resources Content-type. This will produce multiple web_url to request the JSON source. In addition, the JSON request will be added to the Extra_res node.

Add content types to the ' non-resources ' list in the Vugen recorder.

Start recording and perform the test, and remember that you must make sure that Recording toolbar has events that show the record.

After the Vugen test is stopped, a test script is generated. Here is a test example:

 action ()  {    

Ensure that the playback scripts are correct, and scripts often need to be customized to correctly simulate user interaction (parameters, correlation, think times, pacing, etc.)

Record and replay network traffic can be traced in the tree view .

If the script is ready, it can be used as a load test as a user visits a central site .

I hope this brief introduction will help you set up the load test for Android apps .

Record Android apps with HP LoadRunner Vugen

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.