LR通过录制android模拟器来产生脚本--疑问
网上找的帖子,通过Mobile Application - HTTP/HTML 协议调用android模拟器AVD中手机操作的通信数据;录制成功后无法并发增压,提示脚本无效;以下是录制的脚本,(打开浏览器,进入谷歌首页)求大大指点以下如何增压或者如何使者脚本可用或者最好有更好的方法模拟手机应用客户端并发测试:
Action()
{
web_add_cookie("NID=67=P91hA_LMmDlBZOM8jywUSheKgByVJMZItonA1qyfJyx8nZ344YARVh48MQGc_oI4iPq4twLoV_iyhaddhjwZ5-UyPHTFhzAnPN8J6Z8F0GJ4hDLd08VZ78WsQx9cZFOm; DOMAIN=www.google.com.hk");
web_url("m",
"URL=http://www.google.com/m?client=ms-android-google&source=android-home",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=http://www.google.com.hk/webhp?client=ms-android-google&source=android-home&mnfst=1", "Referer=", ENDITEM,
"Url=http://www.google.com.hk/images/nav_logo123.png", "Referer=", ENDITEM,
"Url=http://www.google.com.hk/xjs/_/js/k=-a-Y2-EB9_w.en_US./m=c,sb_mob,cdos,jp,rcs,owm,tbui,mbsk,mb,wob,cfm,dvl,nmns,tiu,ivf,mld,lu,nvm,mbsf,cirosm,tnt,amcl,bct,kpm,lc,mad,mlr,ob,r,rsn,sf,sfa,tbpr,hsm,pcc,csi/am=YA/rt=j/d=1/sv=1/rs=AItRSTP6yrgiB25bw4J23IjjeaWuml7ahg", "Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home", ENDITEM,
"Url=http://www.google.com.hk/mbd?newwindow=1&safe=strict&client=ms-android-google&source=android-home&output=search&mbtype=56", "Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home", ENDITEM,
LAST);
web_add_cookie("PREF=ID=a3137a6d8c10653b:FF=0:NW=1:TM=1369209121:LM=1369209121:S=XbLceJzPTVU-z1TC; DOMAIN=www.google.com");
web_url("m_2",
"URL=http://www.google.com.hk/m?client=ms-android-google&source=android-home",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=http://www.google.com/images/nycli1.gif", "Referer=", ENDITEM,
"Url=/xjs/_/js/k=-a-Y2-EB9_w.en_US./m=c,sb_mob,cdos,jp,rcs,owm,tbui,mbsk,mb,wob,cfm,dvl,nmns,tiu,ivf,mld,lu,nvm,mbsf,cirosm,tnt,amcl,bct,kpm,lc,mad,mlr,ob,r,rsn,sf,sfa,tbpr,hsm,pcc,csi/am=YA/rt=j/d=1/sv=1/rs=AItRSTP6yrgiB25bw4J23IjjeaWuml7ahg", "Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home", ENDITEM,
"Url=http://www.google.com/images/srpr/logo3w.png", "Referer=", ENDITEM,
"Url=/xjs/_/js/k=-a-Y2-EB9_w.en_US./m=gf,adp,sy31,sy32,sy34,sy36,sy40,sy35,sy41,sy37,sy43,sy45,sy42,sy28,sy61,sy38,sy44,sy74,sy60,sy18,sy39,sy59,sy62,sy75,sy78,sy79,sy80,sy83,sy24,llc,df,dob,vs/am=YA/rt=j/d=0/sv=1/rs=AItRSTP6yrgiB25bw4J23IjjeaWuml7ahg", "Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home", ENDITEM,
LAST);
lr_think_time(4);
web_url("gen_204",
"URL=http://www.google.com.hk/gen_204?v=3&s=mobilewebhp&action=&conn=CELL_3G&e=17259,140438,4000116,4001350,4001947,4002693,4003242,4003714,4003881,4003921,4004204,4004319,4004334,4004788,4004844,4004897,4004939,4004949,4004972,4005031,4005154,4005198,4005335,4005817,4006192,4006374,4006442,4006448,4006449,4006541,4006578,4006609,4006727,4006779,4006806,4007007,4007009,4007020,4007055,4007060,4007066,4007073,4007077,4007117,4007118,4007131,4007140,4007158,4007217&ei=&imc=2&imn=2&imp=2&atyp=csi&adh="
"&rt=xjsls.378,prt.489,ol.26374,iml.1538,xjses.30950,xjsee.35279,xjs.35744",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home",
"Mode=HTML",
LAST);
lr_think_time(13);
web_url("search",
"URL=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l=mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.google.com.hk/m?client=ms-android-google&source=android-home",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=/xjs/_/js/k=-a-Y2-EB9_w.en_US./m=c,sb_mob,cdos,jp,rcs,owm,tbui,mbsk,mb,wob,cfm,dvl,tiu,ivf,mld,lu,nvm,mbsf,cirosm,tnt,amcl,bct,kpm,lc,mad,mlr,ob,r,rsn,sf,sfa,tbpr,hsm,pcc,csi/am=YA/rt=j/d=1/sv=1/rs=AItRSTP6yrgiB25bw4J23IjjeaWuml7ahg", "Referer=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l=mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.", ENDITEM,
LAST);
web_add_cookie("BAIDUID=758EF9C76FF4E39E5B2CA70B19E4D1BC:FG=1; DOMAIN=wapbaike.baidu.com");
web_add_cookie("BAIDUID=758EF9C76FF4E39E5B2CA70B19E4D1BC:FG=1; DOMAIN=nsclick.baidu.com");
web_add_cookie("BAIDUID=758EF9C76FF4E39E5B2CA70B19E4D1BC:FG=1; DOMAIN=img.baidu.com");
web_url("url",
"URL=http://www.google.com.hk/url?sa=t&source=web&cd=2&ved=0CDAQFjAB&url=http%3A%2F%2Fbaike.baidu.cn%2Fview%2F5812.htm&ei=o4-dUcb6L5CvkgWgyoGYCQ&usg=AFQjCNGxW2RpV7CRET7UlQTMBgLwsceJ6g",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l=mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=http://nsclick.baidu.com/v.gif?pid=103&url=http%3A%2F%2Fwapbaike.baidu.com%2Fview%2F5812.htm&type=6014&t=1369280379381", "Referer=http://wapbaike.baidu.com/view/5812.htm", ENDITEM,
"Url=http://nsclick.baidu.com/v.gif?pid=103&url=http%3A%2F%2Fwapbaike.baidu.com%2Fview%2F5812.htm&type=7506&t=1369280379398", "Referer=http://wapbaike.baidu.com/view/5812.htm", ENDITEM,
"Url=http://img.baidu.com/hunter/m/baike.js?st=-15849", "Referer=http://wapbaike.baidu.com/view/5812.htm", ENDITEM,
"Url=http://nsclick.baidu.com/u.gif?ts=k&pid=241&sid=hh1e6o07fqfbo&hid=9487&page=bkm-view&ver=5&p=102&px=320*401&ref=http%3A%2F%2Fwww.google.com.hk%2Fsearch%3Fnewwindow%3D1%26safe%3Dstrict%26client%3Dms-android-google%26source%3Dandroid-home%26site%3Dwebhp%26source%3Dhp%26ei%3DcI-dUYGlKYaMkwXX74D4Dg%26q%3D5812%26oq%3D%26gs_l%3Dmobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.&vquery=%E4%B8%89%E4%BA%9A&cmd=open", "Referer=http://wapbaike.baidu.com/view/5812.htm", ENDITEM,
"Url=/xjs/_/js/k=-a-Y2-EB9_w.en_US./m=gf,adp,wta,sy31,sy32,sy34,sy36,sy40,sy35,sy41,sy37,sy43,sy45,sy42,sy28,sy61,sy38,sy44,sy74,sy60,sy18,sy39,sy59,sy62,sy75,sy78,sy79,sy80,sy83,sy24,llc,df,dob,sy95,kptm,vs/am=YA/rt=j/d=0/sv=1/rs=AItRSTP6yrgiB25bw4J23IjjeaWuml7ahg", "Referer=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l="
"mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.", ENDITEM,
LAST);
lr_think_time(4);
web_url("gen_204_2",
"URL=http://www.google.com.hk/gen_204?atyp=i&ct=&cad=&mrto=88&ei=o4-dUcb6L5CvkgWgyoGYCQ&zx=1369280394569",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l=mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.",
"Mode=HTML",
LAST);
web_url("gen_204_3",
"URL=http://www.google.com.hk/gen_204?v=3&s=web&action=&conn=CELL_3G&e=17259,140438,4000116,4001350,4001947,4002693,4003242,4003714,4003881,4003921,4004204,4004319,4004334,4004788,4004844,4004897,4004939,4004949,4004972,4005031,4005154,4005198,4005335,4005763,4005766,4005817,4005878,4006192,4006374,4006442,4006448,4006449,4006453,4006454,4006497,4006541,4006578,4006609,4006695,4006727,4006779,4006806,4007007,4007009,4007020,4007055,4007060,4007066,4007073,4007077,4007117,4007118,4007131,4007140,"
"4007158,4007217&ei=o4-dUcb6L5CvkgWgyoGYCQ&imc=2&imn=2&imp=2&atyp=csi&adh=&rt=xjsls.1297,prt.1326,ol.26147,iml.2295,xjses.30407,xjsee.35151,xjs.35558",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.google.com.hk/search?newwindow=1&safe=strict&client=ms-android-google&source=android-home&site=webhp&source=hp&ei=cI-dUYGlKYaMkwXX74D4Dg&q=5812&oq=&gs_l=mobile-gws-hp.1.0.41.0.0.0.14968.2.0.0.2.2.0.0.0..0.0...0.0...1c..14.mobile-gws-hp.",
"Mode=HTML",
EXTRARES,
"Url=/webhp?client=ms-android-google&source=android-home&mnfst=1", "Referer=", ENDITEM,
"Url=/images/nav_logo123.png", "Referer=", ENDITEM,
LAST);
web_url("m_3",
"URL=http://www.google.com.hk/m?client=ms-android-google&source=android-home",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"Url=http://www.google.com/images/nycli1.gif", "Referer=", ENDITEM,
"Url=http://www.google.com/images/srpr/logo3w.png", "Referer=", ENDITEM,
LAST);
return 0;
} 自己顶起来~ 帮你顶一下!你这脚本是怎样录制的,可以告诉我吗?我也想学学! 我也顶一下!你怎样录制的,能告诉我步骤吗? 顶一下,求录制过程。 回复 4# 张亚洲
步骤就是
1:新建LR脚本。协议选择Mobile Application - HTTP/HTML
2:在record里选择第三个:Record Emulator........
3:选择下一步后,在emulator to record选择模拟器tools目录下的emulator.exe
command line 里输入avd虚拟机的名称:用@连接如@test
working directory 随便选个路径就行了
4:然后运行,就会自动启动模拟器,不会录制操作,只会根据发送的网络数据分析来产生脚本;
各位录制完了。也研究下怎么增压。。求告知 木有人关注一下么。不能沉啊。下礼拜要测试了。。求大神~ 你的LR是哪个版本的啊!是破解版的吗?
其实你可以找开发写的接口,进行压力测试。比这个容易多了。 回复 8# 张亚洲
我也是问过开发。他说就能写发送数据的,不能写并发的。如果这样怎么用增压呢?用.net写的 用jmeter 试试!测试HTTP请求。只要有请求接口就行> 同一个问题
步骤就是
1:新建LR脚本。协议选择Mobile Application - HTTP/HTML
2:在record里选择第三个:Record Emulator........
3:选择下一步后,在emulator to record选择模拟器tools目录下的emulator.exe
command line 里输入avd虚拟机的名称:用@连接如@test
working directory 随便选个路径就行了
4:然后运行,无法自动启动模拟器,不会录制操作 还有就是 手机调用webservice服务 .net开发怎么做性能测试 回复 6# yao2631488
你好,我刚装了LR11.5,能找到Mobile Application HTTP/HTML,但是第2点开始的在record里选择第三个:Record Emulator........
3:选择下一步后,在emulator to record选择模拟器tools目录下的emulator.exe
command line 里输入avd虚拟机的名称:用@连接如@test
working directory 随便选个路径就行了
-----------第2点开始的Record是怎么出现的? 我用的LR11.00,没有找到Mobile Application HTTP/HTML协议 只要你知道服务器怎么验证你的客户端类型,然后你就发现其实自己写请求都不是什么难事,以前写过Iphone4怎么做脚本的,自己可以搜索一下。 loadrunner11.5 没有破解版并发用户很少,
你可以使用下kylinPET工具,到他们的官网下载www.kylinpet.com,也有技术支持。智能手机录制需要你通过抓包软件把业务(浏览器的HTTP)交互抓下来,手机上抓包可以使用tcpdump(要有权限),也可以在服务器抓包。把抓包文件保存下来就可以通过kylinPET读取抓包文件生成脚本,跟实时录制一样。
抓包时可以设置过滤条件,如port 80,这样抓到的报文就只有业务相关的,还有使用tcpdump时注意抓包时抓包长度要设置为1500 回复 11# fsweicaixia
LR11.5可以测试手机上得应用是吗? yao2631488 发表于 2013-5-24 09:07
回复 4# 张亚洲
步骤就是
1:新建LR脚本。协议选择Mobile Application - HTTP/HTML
hello,yao2631488,我也学学,咨询下:
LR11可以么?我启动之后提示emulator-arm.exe已停止工作!
还有个问题,录制之前是不是需要把应用部署到AVD上??具体应该怎么部署?
thanks!! 楼主,为什么我录制的时候event=0呢 lr 12能调用模拟器的,只是录制的是时候没有脚本,只有客户端同服务端的字节的数据,停止录制后,没脚本文件
页:
[1]
2