|
本帖最后由 ericzhou2009 于 2011-4-7 16:56 编辑
请问专家,利用LR如何做WEB接口的性能测试?
我一朋友做接口压力测试是这样的
1、一个访问接口URL:http://10.11.104.99:8080/hwmarket/client/gallery-shelves.do?sign=A22B42C1D120E0F1299028247073&test=test&maxResults=10&reqPageNum=1
该URL在浏览器中返回页面如下信息:
{"count":9,"list":[{"id":"1fd9c45cece34038a807a122e447ac5e","icon":"http://10.11.104.99:8080/hwmarket/files/application/logentity/33e9968c7c6045679d84e36bc6fa0b05.png?source=client_down","action":"com.huawei.appmarket.taobaozone.LAUNCH_ACTION","releaseDate":"2011-01-06","alias":"Game","url":"http://10.11.104.99:8080/hwmarket/client/query-shelvesToJson-shelves.do?id=C974&sign=A22B42C1D120E0F1299028247073","kindId":"2","downloads":"228813","name":"淘宝专区","developer":"APP虎","update":"0","galleryImage":"http://10.11.104.99:8080/hwmarket/files/waplinkcommd/1fd9c45cece34038a807a122e447ac5e.png","price":"0","package":"com.huawei.appmarket.taobaozone","comNum":"3575","versionCode":"12","stars":"4"},{"id":"C974","icon":"http://10.11.104.99:8080/hwmarket/files/application/logentity/33e9968c7c6045679d84e36bc6fa0b05.png?source=client_down","action":"0","releaseDate":"2011-01-06","alias":"Game","url":"http://10.11.104.99:8080/hwmarket/client/query-shelvesToJson-shelves.do?id=C974&sign=A22B42C1D120E0F1299028247073","kindId":"2","downloads":"228813","name":"APP虎多嘴猫","developer":"APP虎","galleryImage":"http://10.11.104.99:8080/hwmarket/files/application/commend/33e9968c7c6045679d84e36bc6fa0b05.png?source=client_down","price":"0","package":"com.outfit7.talkingtom","comNum":"3575","versionCode":"2","stars":"4"},{"id":"C191","icon":"http://10.11.104.99:8080/hwmarket/files/application/logentity/eb5c101dffa14297a6597397d59ad5a0.png?source=client_down","action":"0","releaseDate":"2010-10-25","alias":"Entertainment","url":"http://10.11.104.99:8080/hwmarket/client/query-shelvesToJson-shelves.do?id=C191&sign=A22B42C1D120E0F1299028247073","kindId":"3","downloads":"347640","name":"手机电视","developer":"闪动科技","galleryImage":"http://10.11.104.99:8080/hwmarket/files/application/commend/eb5c101dffa14297a6597397d59ad5a0.png?source=client_down","price":"0","package":"dopool.player","comNum":"2349","versionCode":"13","stars":"4"},{"id":"C242","icon":"http://10.11.104.99:8080/hwmarket/files/application/logentity/a90e5358878141b8b07617c05bb5806c.png?source=client_down","action":"0","releaseDate":"2011-03-14","alias":"System,Tools","url":"http://10.11.104.99:8080/hwmarket/client/query-shelvesToJson-shelves.do?id=C242&sign=A22B42C1D120E0F1299028247073","kindId":"12,4","downloads":"3972","name":"上网管家","developer":"OPDA沃达网","galleryImage":"http://10.11.104.99:8080/hwmarket/files/application/commend/a90e5358878141b8b07617c05bb5806c.png?source=client_down","price":"0","package":"com.koufeikexing","comNum":"21","versionCode":"16","stars":"4"},type":"1","totalPages":1}
2、然后就利用Virtual User Generator录制该接口脚本
接口脚本如下:
Action()
{
lr_rendezvous("rendezvous");
lr_start_transaction("应用列表接口");
lr_think_time(1);
web_add_cookie("sdmenu_my_menu=100000; DOMAIN=10.82.130.171");
web_url("gallery-shelves.do",
"URL=http://10.11.104.99:8080/hwmarket/client/gallery-shelves.do?sign={sign}&test=test&maxResults=10&reqPageNum=1",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_end_transaction("应用列表接口", LR_AUTO);
return 0;
}
并对脚本进行了参数化、加了集合点、事务等
3、然后就对这个脚本进行加压了
请问,这样做WEB接口压力测试是否存在问题?该如何操作呢? |
|