51Testing软件测试论坛

标题: 用loadrunner 对接口进行压测 我不知道我的脚本这样写行不行 [打印本页]

作者: UUchloe    时间: 2017-6-26 18:19
标题: 用loadrunner 对接口进行压测 我不知道我的脚本这样写行不行

描述:通过输入省市和详细地址   在地图上来匹配范围

脚本贴上来   新人一枚这个是根据资料来写的脚本 ,欢迎指正,谢谢~
Action()
{

        lr_think_time(0);

       
        lr_rendezvous("run");
    lr_start_transaction("gis");

   /*web_reg_find("Text=\"Status\":200",
                                 "Fail=NotFound",
                                 "Search=Body",
                                LAST);*/


        web_submit_data("zkau_15",
                "Action=http://testbs.kuaiyun.net.cn/zkau",
                "Method=POST",
                "RecContentType=text/plain",
                "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul",
                "Snapshot=t24.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=dtid", "Value=z_w4a", ENDITEM,
                "Name=cmd_0", "Value=onChange",
                                         ENDITEM,
                "Name=uuid_0", "Value=p4HQks0",
                                        ENDITEM,
                "Name=data_0", "Value={\"value\":\"浙江省\",\"start\":0}",
                                         ENDITEM,
                "Name=cmd_1", "Value=onSelect",
                                        ENDITEM,
                "Name=uuid_1", "Value=p4HQks0",
                                        ENDITEM,
                "Name=data_1", "Value={\"items\":[\"p4HQcb1\"],\"reference\":\"p4HQcb1\"}",
                                        ENDITEM,
                LAST);

        web_submit_data("zkau_16",
                "Action=http://testbs.kuaiyun.net.cn/zkau",
                "Method=POST",
                "RecContentType=text/plain",
                "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul",
                "Snapshot=t25.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=dtid", "Value=z_w4a",
                                         ENDITEM,
                "Name=cmd_0", "Value=onChange",
                                         ENDITEM,
                "Name=uuid_0", "Value=p4HQos0",
                                        ENDITEM,
                "Name=data_0", "Value={\"value\":\"杭州市\",\"start\":0}",
                                        ENDITEM,
                "Name=cmd_1", "Value=onSelect",
                                        ENDITEM,
                "Name=uuid_1", "Value=p4HQos0",
                                         ENDITEM,
                "Name=data_1", "Value={\"items\":[\"p4HQg51\"],\"reference\":\"p4HQg51\"}",
                                        ENDITEM,
                LAST);
       

        web_submit_data("zkau_17",
                "Action=http://testbs.kuaiyun.net.cn/zkau",
                "Method=POST",
                "RecContentType=text/plain",
                "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul",
                "Snapshot=t26.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=dtid", "Value=z_w4a", ENDITEM,
                "Name=cmd_0", "Value=onChange", ENDITEM,
                "Name=uuid_0", "Value=p4HQ1t0", ENDITEM,
                "Name=data_0", "Value={\"value\":\"水利水电学校\",\"start\":0}", ENDITEM,
                "Name=cmd_1", "Value=onClick", ENDITEM,
                "Name=uuid_1", "Value=p4HQ2t0", ENDITEM,
                "Name=data_1", "Value={\"pageX\":1190,\"pageY\":259,\"which\":1,\"x\":60,\"y\":11}", ENDITEM,
                EXTRARES,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-ol-hr.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-ol-corner.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-ol-hm.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-icon.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-ol-clr.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                "Url=/zkau/web/2b0722c7/zul/img/wnd/wnd-ol-hl.png", "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul", ENDITEM,
                LAST);


        web_url("csViewMap.do",
                "URL=http://testgis.kuaiyun.net.cn/zt-gis/gisView/csViewMap.do?param={\"provinceId\":\"30044\",\"provinceName\":\"浙江省\",\"cityId\":\"30800\",\"siteId\":\"2172\",\"cityName\":\"杭州市\",\"areaId\":\"0\",\"areaName\":\"\",\"address\":\"水利水电学校\"}",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://testbs.kuaiyun.net.cn/apps/index.zul",
                "Snapshot=t27.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=http://webapi.amap.com/theme/v1.3/style1.3.28.4.css", "Referer=http://testgis.kuaiyun.net.cn/zt-gis/gisView/csViewMap.do?param={\"provinceId\":\"30044\",\"provinceName\":\"娴欐睙鐪\x81\",\"cityId\":\"30800\",\"siteId\":\"2172\",\"cityName\":\"鏉窞甯\x82\",\"areaId\":\"0\",\"areaName\":\"\",\"address\":\"姘村埄姘寸數瀛︽牎\"}", ENDITEM,
                "Url=http://webapi.amap.com/maps/main?v=1.3&key=2e968e807406c2aeace6cae93fc7a1ae&m=http,map,anip,layers,overlay0,brender,mrender,mouse,AMap.PlaceSearch,sync&vrs=1.3.28.4", "Referer=http://testgis.kuaiyun.net.cn/zt-gis/gisView/csViewMap.do?param={\"provinceId\":\"30044\",\"provinceName\":\"娴欐睙鐪\x81\",\"cityId\":\"30800\",\"siteId\":\"2172\",\"cityName\":\"鏉窞甯\x82\",\"areaId\":\"0\",\"areaName\":\"\",\"address\":\"姘村埄姘寸數瀛︽牎\"}", ENDITEM,
                "Url=http://restapi.amap.com/v3/log/init?s=rsv3&product=JsInit&key=2e968e807406c2aeace6cae93fc7a1ae&t=1498457586987&resolution=undefined*undefined&mob=0&vt=0&dpr=undefined&scale=1&detect=false&callback=jsonp_191288_&platform=JS&logversion=2.0&sdkversion=1.3&appname="
                "http%3A%2F%2Ftestgis.kuaiyun.net.cn%2Fzt-gis%2FgisView%2FcsViewMap.do%3Fparam%3D%7B%22provinceId%22%3A%2230044%22%2C%22provinceName%22%3A%22%E6%B5%99%E6%B1%9F%E7%9C%81%22%2C%22cityId%22%3A%2230800%22%2C%22siteId%22%3A%222172%22%2C%22cityName%22%3A%22%E6%9D%AD%E5%B7%9E%E5%B8%82%22%2C%22areaId%22%3A%220%22%2C%22areaName%22%3A%22%22%2C%22address%22%3A%22%E6%B0%B4%E5%88%A9%E6%B0%B4%E7%94%B5%E5%AD%A6%E6%A0%A1%22%7D&csid=5098D545-5DDB-4CE9-97A7-58EE3192C2D4", "Referer=http://testgis.kuaiyun.net.cn/"
                "zt-gis/gisView/csViewMap.do?param={\"provinceId\":\"30044\",\"provinceName\":\"娴欐睙鐪\x81\",\"cityId\":\"30800\",\"siteId\":\"2172\",\"cityName\":\"鏉窞甯\x82\",\"areaId\":\"0\",\"areaName\":\"\",\"address\":\"姘村埄姘寸數瀛︽牎\"}", ENDITEM,
                "Url=http://webapi.amap.com/count?type=f&k=2e968e807406c2aeace6cae93fc7a1ae&u="
                "http%253A%252F%252Ftestgis.kuaiyun.net.cn%252Fzt-gis%252FgisView%252FcsViewMap.do%253Fparam%253D%257B%2522provinceId%2522%253A%252230044%2522%252C%2522provinceName%2522%253A%2522%25E6%25B5%2599%25E6%25B1%259F%25E7%259C%2581%2522%252C%2522cityId%2522%253A%252230800%2522%252C%2522siteId%2522%253A%25222172%2522%252C%2522cityName%2522%253A%2522%25E6%259D%25AD%25E5%25B7%259E%25E5%25B8%2582%2522%252C%2522areaId%2522%253A%25220%2522%252C%2522areaName%2522%253A%2522%2522%252C%2522address%2522%253A%2522%25"
                "E6%25B0%25B4%25E5%2588%25A9%25E6%25B0%25B4%25E7%2594%25B5%25E5%25AD%25A6%25E6%25A0%25A1%2522%257D&m=0&pf=windows&methods=ev,a&methodsParams=&options=&optionsValue=&cbk=jsonp_185045_&csid=449750A1-38E4-4330-AC40-DEE1A08FBAC4", "Referer=http://testgis.kuaiyun.net.cn/zt-gis/gisView/csViewMap.do?param={\"provinceId\":\"30044\",\"provinceName\":\"娴欐睙鐪\x81\",\"cityId\":\"30800\",\"siteId\":\"2172\",\"cityName\":\"鏉窞甯\x82\",\"areaId\":\"0\",\"areaName\":\"\",\"address\":\"姘村埄姘寸數瀛︽牎\"}", ENDITEM,
                LAST);


        lr_end_transaction("gis",LR_AUTO);

        return 0;
}



作者: jingzizx    时间: 2017-6-26 23:04
直接运行,服务端打印日志




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2