51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1327|回复: 1
打印 上一主题 下一主题

[求助] 用loadrunner 对接口进行压测 我不知道我的脚本这样写行不行

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2017-6-26 18:19:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

脚本贴上来   新人一枚这个是根据资料来写的脚本 ,欢迎指正,谢谢~
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;
}


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

  • TA的每日心情
    奋斗
    7 小时前
  • 签到天数: 2819 天

    连续签到: 1 天

    [LV.Master]测试大本营

    2#
    发表于 2017-6-26 23:04:30 | 只看该作者
    直接运行,服务端打印日志

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 积极回复获得测试积点10 赶快去商城换取奖.

    查看全部评分

    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-25 14:46 , Processed in 0.067848 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表