LoadRunner 录制 mobile

方法一:本地安装安卓模拟器,用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

Article Options

Recording HTTP traffic on iOS devices with HP LoadRunner

More Sharing Services

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

Post a Comment

(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....

Tags: HP LoadRunner| iOS| mobile| network traffic| performance| View All (7)

Labels: Load Testing

Everyone‘s Tags:

View All (7)

Labels:

时间: 2024-11-04 04:23:58

LoadRunner 录制 mobile的相关文章

通过Loadrunner 录制ISO设备的HTTP请求

通过Loadrunner 录制ISO设备的HTTP请求 由于andriod平台,HP提供了HP Loadrunner Mobile Recorder 在andriod上进行记录交互信息,但是对于IOS却没有,因此在loadrunner12中提供了Proxy Recorder的方式对IOS的http协议进行了录制.这个新的组件可以使loadrunner记录远端主机的http请求,并形成脚本. PS:HP Loadrunner Mobile Recorder HP Loadrunner 12 下载

LoadRunner 录制IE 8卡死

LoadRunner 录制IE 8卡死 LoadRunner11录制脚本,对IE的版本是有所限制的,它只是支持IE 8 以下版本,其中包括IE 8,高出IE 8版本Loadrunner是不支持的. 我遇到LoadRunner录制脚本时IE8卡死,解决的方案: 首先查看一下在不录制脚本的情况下,手写一些代码,例如:输出一些字符: lr_out_message("aaaa") 看能否回放时在Replay log中有aaaa的出现,如果有的话,说明安装没有问题,这时就按着下面的步骤去检查.如

LoadRunner录制图片验证码

LoadRunner录制图片验证码 LoadRunner自身是无法捕获到图片验证码的,但是我们可以帮助LoadRunner来实现验证码的捕获. 1.图片验证码 图片验证码的产生来自服务器端,由服务器生成随机数,然后写入到图片中.虽然LR可以录制下图片,但是无法从图片中获取数据,因此表面上看LR是无法跳过这关了,那么我们从服务器下手,通常产生的随机数是保存在session中,所以我们可以想办法获取到这个session.    a.针对应用,采用不同的语言,本次讲的是java应用,首先写个*.jsp

Loadrunner录制https脚本

Loadrunner录制https脚本 原创 2017-07-10 爱测未来 爱测未来 随着公司的发展,公司原有的SVN服务器存放的内容不断增加,容量已经不能满足后续需求,首先我们想到对服务器进行扩容,然而因为各种原因服务器不能进行扩容,所以公司决定更换新的SVN服务器,在做数据迁移和环境部署之前我们需要对服务器进行一次性能测试,了解部署后的服务器性能,测试过程中需要对https的网页进行性能测试. 我们可以用loadrunner录制http网页,但是当录制https网页的时候会发现证书错误不能

解决loadrunner录制页面的乱码问题

以下亲自验证了的:好用. 三步解决loadrunner录制页面的乱码问题 第一步:去lr 的vugen的Tools -> Recoding Options -> Advanced -> Support charset -> UTF-8 选上. 第二步:把IE的编码选择成UTF-8(我的默认就是,又选了一遍才好的,不然好不了). 第三步:在lr的测试结果页面里面,什么也不选中,点右键,选择简体中文(因为我的LR的测试页面此时中文变成了乱码). 对第三步进一步的解释:录制过程中,IE页

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

用Loadrunner录制上传文件,脚本回放时发现,文件没有上传成功,检查脚本发现脚本中没有上传文件的路径. 脚本录制时选择的协议,如果说是socket协议,则不需要上传文件的路径,Loadrunner会把要上传的文件转义成一种特殊编码形式的文件,放在data.ws对应的buf中,运行脚本是直接上传buf中的内容如果是http/html协议,选择URL-based script,web_submit_data中会显示要上传文件的文件名,脚本中不会显示路径,默认路径在当前脚本保存的路径下,把上传的

Loadrunner 录制成功,但是脚本并没有产生

LR 在用IE 录制脚本已经成功,但是结束录制以后,并没有脚本产生,在产生脚本log 中提示: [Net An. Error    (14c8:1cec)] Request Connection: Remote Server @ 127.0.0.1:8010   (Service=)  NOT PROXIED! (REASON: Unable to connect to remote server: rc = -1 , le = 0) 解决方案: Record Option --> Networ

loadrunner录制成功但脚本内容为空,无任何代码//脚本中包含乱码

使用loadrunner录制脚本,录制过程中也会显示“正在录制…”,并且有(XX个事件).但是脚本录制结束之后,脚本中没有任何内容,没有代码显示. 解决方法: 在脚本录制程序VU generator中, 点“工具”——“录制选项”, 左边栏目中,“网络”——“端口映射”, 右边窗口中,在“捕获级别”的下拉列表中选择“套接字级别数据和WinINet级别数据”, 确定. 重新录制脚本,可查看到有对应于事件操作的代码记录. 使用loadrunner录制脚本,有时有个别网页页面会出现乱码的情况,在录制的

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

测试环境:win7+LoadRunner11+ie9 遇到的问题:用LoadRunner录制时,打开百度,总是报安全证书问题,如图所示 解决方法:Tools——Recording Options——port mapping中的capture level 设置为 winnet level data即可