方法一:本地安装安卓模拟器,用LR选择模拟器录制方式录制
方法二:手机真机需要root,可以在电脑上下载一键root工具(如卓大师),然后手机和电脑用数据线连接,然后root。
在手机上运行 Mobile Recorder
按 “Start Recording”开始录制
切换到你们的手机客户端,完成正常的操作步骤
切换回Mobile recorder,点 “Stop Recording”
用email发送抓到的数据包或者把数据文件(扩展名是lrcap)直接copy到 VuGen上
新建mobile http脚本->record->选择”Analyze traffic”->capture file选择上面生成的lrcap文件,指定server的IP和port或者手机的IP->Finish

http://h30499.www3.hp.com/t5/HP-LoadRunner-and-Performance/Recording-HTTP-traffic-on-iOS-devices-with-HP-LoadRunner/ba-p/6582844#.VUhcVZNUnCD

 
 
 
 

Recording HTTP traffic on iOS devices with HP LoadRunner

MalcolmIsaacs| August 22, 2014 - last edited August 28, 2014

(This post was written by Gennady Gorenshtein from the LoadRunner R&D Team)

iOS devices such as iPhones and iPads have become a valuable part of the IT infrastructure, and accordingly, there is a need to validate the performance of these devices as they run applications.  LoadRunner, as the leading performance load testing tool in the market, is the perfect choice for this validation. To get started, LoadRunner needs to obtain the HTTP activity performed by the device. Because LoadRunner’s network traffic recording mechanism doesn’t run on iOS, we have a way of getting at the HTTP activity. This post describes some of the solutions that LoadRunner offers to solve this problem.

LoadRunner Proxy Recorder

Starting from version 11.52, LoadRunner includes a new component called Proxy Recorder. This component is responsible for recording the HTTP activity that takes place on the remote host. In short, the remote host simply sees LoadRunner’s Proxy Recorder as a regular HTTP proxy and routes all the HTTP network activity through it. LoadRunner then captures the remote host’s HTTP traffic and creates a script for the load testing.

Since any iOS device can be seen as remote network host, we can use LoadRunner’s Proxy Recorder to capture the device’s HTTP activity.

If you haven’t downloaded HP LoadRunner, here is your opportunity to see what it can do for you! Dow...

Configuring VuGen

First, set the recording mode to ‘Remote Application via LoadRunner Proxy’ mode in VuGen’s Start Recording dialog:

The proxy mechanism will be launched when you press the “Start Recording” button. You then need to configure the settings for the device—which may use a wireless connection or a cellular connection. The settings for each connection type are slightly different.

Configuring the device’s proxy settings for a wireless connection

Configure the proxy settings on the device by going into the device’s Wi-Fi settings and configuring the network to use a manual HTTP proxy. Set the IP and port to the values in the dialog above (10.0.0.11 and 8888 in the example here):

From now on, LoadRunner will record any HTTP network activity on the device.

As an alternative to using an actual iOS device, LoadRunner can record from the iOS emulator on OS X, using the same settings: LoadRunner Proxy Recording should be started on the Vugen machine, and the emulator’s proxy should be configured to point to Vugen’s IP and proxy port.  You can check out this post for more information about proxy recording in LoadRunner for mobile applications.

Configuring the device’s proxy settings for a cellular connection

To record a cellular network connection, create a special APN (Access Point Name) profile and load it onto the device. You can use the iPhone Configuration Utility, available for Windows and OS X, to create the APN. This screenshot shows how to create a profile on OS X:

Proxy server and Port settings should point to the LoadRunner Proxy IP and port.

To load the profile onto the device, it can be loaded through the iPhone Configuration utility, downloaded as a file, or emailed as an attachment.

If you need to record SSL traffic, you need to obtain and install the LoadRunner Proxy SSL CA certificate on the device. To obtain the certificate, point your device’s browser to http://lr_proxy_ip:80/proxyroot.cer (note that it is usually a good idea to install the certificate before recording in any case, even if you don’t know for sure that you’re going to use SSL communication, as SSL sessions often start implicitly). After that, save the downloaded certificate and install it on the device:

Wireshark recording

Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education. In promiscuous mode, Wireshark is capable of capturing all traffic that passes through the network interface, regardless whether the traffic is intended for this interface or not. Wi-Fi network activity (called also WLAN) passes through all participating network adapters. In other words, promiscuous mode captures network traffic between all devices connected to the same WLAN.

LoadRunner is capable of analyzing of Wireshark capture files and creating LoadRunner scripts from the capture files. You can configure it as follows:

  • Configure your device to run in a wireless network with Wireshark installed on some of the computers on the network.
  • Start Wireshark, choose the wireless interface, and check the ‘Capture packets in promiscuous mode’ checkbox:

Start the Wireshark capture process, generate some HTTP activity on your device, and save the captured activity to a file.

You then import the file into LoadRunner and create the script by running VuGen’s Recording Wizard, and selecting ‘Analyze Traffic’:

Filter the traffic based on the device’s IP and create the script:

Server side recording

If the HTTP traffic from the iOS device is directed to a single server, and the user has the sufficient permissions on the server, you can record that traffic on the server itself.

To record traffic on a remote server, you need to manually install the mobile sniffer agent onto your server by copying the relevant folder from <LR installation directory>\mobileRemoteAgent\ to a location of your choice on your server. The following table lists the supported operating systems and their corresponding file directories:

Once you have copied the folder, you initiate the sniffer from the command line. For example, if you are recording in a Windows environment, the command line string might look something like this:

mongoose-2.11.exe -e errorLog.txt -r "C:\Program Files\HP\LoadRunner\mobileRemoteAgent\win32" -c ".cgi" -p 80

Common command arguments and their descriptions:

Once the sniffer agent is installed, you manually start the agent, then select ‘Record and Analyze Traffic’ from the Recording Wizard.

Configure the sniffer agent’s location:

Generate some HTTP activity on your device, and LoadRunner will generate a script from the activity recorded using the sniffer.

Feel free to leave a comment in the box below.

Check out this post for more information about mobile performance testing.

Thanks to Gennady for providing this article!

Download HP LoadRunner for your performance and load testing for free – 50 Virtual users for unlimit....

Labels: Load Testing

LoadRunner 录制 mobile的更多相关文章

  1. LoadRunner录制Web协议的脚本 (by网络)

    LoadRunner录制Web协议的脚本  http://itindex.net/detail/50530-loadrunner-web-脚本

  2. LoadRunner录制图片验证码

    LoadRunner录制图片验证码 LoadRunner自身是无法捕获到图片验证码的,但是我们可以帮助LoadRunner来实现验证码的捕获. 1.图片验证码 图片验证码的产生来自服务器端,由服务器生 ...

  3. LoadRunner录制不弹出IE浏览器,event=0

    系统环境:win7,安装了IE.360.firefox.搜狗高速浏览器: 起初刚装完loadrunner11的时候,选了IE进行录制,就是不能打开IE,算了,那就用loadrunner默认的设置,居然 ...

  4. loadrunner录制脚本出现urs.asmx解决方法:

    在loadrunner录制过程中可能出现如下脚本: 解决方法: 解决办法:打开IE9的Internet选项-->高级,把设置下面安全中“启用SmartScreen筛选器”不选中,IE默认是选中的 ...

  5. 问题:loadrunner录制event为0

     loadrunner录制问题问题1:录制时出现event为0的状况 解决办法: 1.如果是IE浏览器,把启用第三方浏览器扩展*钩给去掉    2使用火狐浏览器,这个就比较好,在lr启动的时候就去勾选 ...

  6. LoadRunner 录制IE 8卡死

    LoadRunner11录制脚本,对IE的版本是有所限制的,它只是支持IE 8 以下版本,其中包括IE 8,高出IE 8版本Loadrunner是不支持的. 我遇到LoadRunner录制脚本时IE8 ...

  7. loadrunner录制、加载以及分析过程

    loadrunner主要组件包括: Virtual User Generator(录制脚本,编写脚本直到调通) Controller(加载脚本,设计并发人数.监控点之类的,模拟场景,开始性能测试,最后 ...

  8. loadrunner录制上传文件,但是回放失败

    用Loadrunner录制上传文件,脚本回放时发现,文件没有上传成功,检查脚本发现脚本中没有上传文件的路径. 脚本录制时选择的协议,如果说是socket协议,则不需要上传文件的路径,Loadrunne ...

  9. loadrunner录制时web时,安全证书问题

    测试环境:win7+LoadRunner11+ie9 遇到的问题:用LoadRunner录制时,打开百度,总是报安全证书问题,如图所示 解决方法:Tools——Recording Options——p ...

随机推荐

  1. 50.分治算法练习:  二分算法:  2703 奶牛代理商 XII

    时间限制: 1 s 空间限制: 32000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 小徐从美国回来后,成为了USACO中国区的奶牛销售代理商,专门出售 ...

  2. 提示框框架KVNProgress介绍

    gitHub上面有很多显示加载进度的框架,这里我们介绍一下KVNProgress框架,KVNProgress是一个可以完全定制的HUD(指示器),你可以设置加载进度的画面是否全屏,可以自己修改进度显示 ...

  3. MOSFET shunt regulator substitutes for series regulator

    You would normally use a series linear regulator or a dc/dc converter to obtain 3V dc from a higher ...

  4. 关于JAVA_HOME, CLASSPATH和PATH的设置

    http://bbs.csdn.net/topics/120079565 1.PATH,这个是给WINDOWS操作系统用的,告诉命令行里,执行的命令行工具在那里,比如java,javac这都是命令行工 ...

  5. MySQL 一个库中表数量是否有限制?

    在网上找了一下,有说几乎没有限制的,也有说表多了肯定会影响性能的,综合起来应该讲: 1)一个库中表数是有限制的, 按照 UNSIGNED 类型,最多42亿多一点,正常应用根本达不到.   2)文件系统 ...

  6. CSS:用SASS(SCSS)实现栅格系统

    背景 在CSS:用Less实现栅格系统中我介绍了如何用LESS实现栅格系统,为啥还要再用SASS做一遍呢?Bootstrap+JQuery+Less做前端(以读取为目的),ExtJs+Sass做后台( ...

  7. Mac OSX 系统目录结构(转)

    摘要 在OS X的系统中,不再有Windows用户熟悉的C盘.D盘,这是因为OS X底层是Unix系统,其目录机构符合Unix系统的规范.MAC机器主板使用了Intel主导的EFI标准,硬盘分区格式采 ...

  8. Win7下安装pip

    1.首先下载setuptools,下载地址https://pypi.python.org/pypi/setuptools#downloads2.解压下载后的文件,进入命令行,将目录切换到解压后文件夹所 ...

  9. Steve Lin:如何撰写一篇优秀的SIGGRAPH论文

     英文原版 PPT下载:http://vdisk.weibo.com/s/z7VKRh2i3R4YO 一篇优秀的论文应该是这样的 广大的研究同仁介绍了这篇论文所包含的重要想法和所获得的结果 在论文中描 ...

  10. 图像处理标准图像lena的故事图The Lenna Story behind image processing

    The Lenna Story - www.lenna.org   Imaging Experts Meet Lenna in Person Yes, it's true! Lenna attende ...