51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1415|回复: 2
打印 上一主题 下一主题

[求助] 压测接口报错

[复制链接]
  • TA的每日心情
    奋斗
    2015-8-11 10:22
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2016-1-5 13:39:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    需要做一个压测,代码如下:
    Action()
    {
    //提交答卷
    web_custom_request("AddAnswerInfo",
    "URL=http://172.20.10.16:9001/Student/AddAnswerInfo",
    "Method=POST",
    "Resource=0",
    "RecContentType=application/json",
    "Referer=",
    "Mode=HTTP",
    "EncType=application/json",

      "Body={\"QuestionID\":\"43\",\"AnswerContent\":\"[{\"id\":\"1084\" ,\"answer\":\"5394\",\"score\":\"1\"},{\"id\":\"1085\" ,\"answer\":\"5397\",\"score\":\"2\"},{\"id\":\"1086\" ,\"answer\":\"5399\",\"score\":\"2\"},{\"id\":\"1087\" ,\"answer\":\"5404\",\"score\":\"4\"},{\"id\":\"1088\" ,\"answer\":\"5411\",\"score\":\"6\"},{\"id\":\"1089\" ,\"answer\":\"5419\",\"score\":\"7\"},{\"id\":\"1090\" ,\"answer\":\"5425\",\"score\":\"7\"},{\"id\":\"1091\" ,\"answer\":\"5430\",\"score\":\"2\"},{\"id\":\"1092\" ,\"answer\":\"5436\",\"score\":\"3\"},{\"id\":\"1093\" ,\"answer\":\"5443\",\"score\":\"5\"},{\"id\":\"1094\" ,\"answer\":\"5445\",\"score\":\"2\"},{\"id\":\"1095\" ,\"answer\":\"5451\",\"score\":\"3\"},{\"id\":\"1096\" ,\"answer\":\"5458\",\"score\":\"5\"},{\"id\":\"1097\" ,\"answer\":\"5460\",\"score\":\"2\"},{\"id\":\"1098\" ,\"answer\":\"5466\",\"score\":\"3\"},{\"id\":\"1099\" ,\"answer\":\"5470\",\"score\":\"2\"},{\"id\":\"1100\" ,\"answer\":\"5478\",\"score\":\"5\"},{\"id\":\"1101\" ,\"answer\":\"5480\",\"score\":\"2\"},{\"id\":\"1102\" ,\"answer\":\"5486\",\"score\":\"3\"},{\"id\":\"1103\" ,\"answer\":\"5490\",\"score\":\"2\"},{\"id\":\"1104\" ,\"answer\":\"5498\",\"score\":\"5\"},{\"id\":\"1105\" ,\"answer\":\"5500\",\"score\":\"2\"},{\"id\":\"1106\" ,\"answer\":\"5507\",\"score\":\"4\"},{\"id\":\"1107\" ,\"answer\":\"5510\",\"score\":\"2\"},{\"id\":\"1108\" ,\"answer\":\"5516\",\"score\":\"3\"},{\"id\":\"1109\" ,\"answer\":\"5519\",\"score\":\"1\"},{\"id\":\"1110\" ,\"answer\":\"5525\",\"score\":\"2\"},{\"id\":\"1111\" ,\"answer\":\"5531\",\"score\":\"3\"},{\"id\":\"1112\" ,\"answer\":\"5538\",\"score\":\"5\"},{\"id\":\"1113\" ,\"answer\":\"5540\",\"score\":\"2\"},{\"id\":\"1114\" ,\"answer\":\"5546\",\"score\":\"3\"},{\"id\":\"1115\" ,\"answer\":\"5550\",\"score\":\"2\"},{\"id\":\"1116\" ,\"answer\":\"5558\",\"score\":\"5\"},{\"id\":\"1117\" ,\"answer\":\"5560\",\"score\":\"2\"},{\"id\":\"1118\" ,\"answer\":\"5566\",\"score\":\"3\"},{\"id\":\"1119\" ,\"answer\":\"5572\",\"score\":\"4\"},{\"id\":\"1120\" ,\"answer\":\"5575\",\"score\":\"2\"},{\"id\":\"1121\" ,\"answer\":\"5583\",\"score\":\"5\"},{\"id\":\"1122\" ,\"answer\":\"5585\",\"score\":\"2\"},{\"id\":\"1123\" ,\"answer\":\"5591\",\"score\":\"3\"},{\"id\":\"1124\" ,\"answer\":\"5595\",\"score\":\"2\"},{\"id\":\"1125\" ,\"answer\":\"5600\",\"score\":\"2\"},{\"id\":\"1126\" ,\"answer\":\"5604\",\"score\":\"1\"},{\"id\":\"1127\" ,\"answer\":\"5611\",\"score\":\"3\"},{\"id\":\"1128\" ,\"answer\":\"5618\",\"score\":\"5\"},{\"id\":\"1129\" ,\"answer\":\"5620\",\"score\":\"2\"},{\"id\":\"1130\" ,\"answer\":\"5626\",\"score\":\"3\"},{\"id\":\"1131\" ,\"answer\":\"5632\",\"score\":\"4\"},{\"id\":\"1132\" ,\"answer\":\"5635\",\"score\":\"2\"},{\"id\":\"1133\" ,\"answer\":\"5639\",\"score\":\"1\"},{\"id\":\"1134\" ,\"answer\":\"5646\",\"score\":\"3\"},{\"id\":\"1135\" ,\"answer\":\"5650\",\"score\":\"2\"},{\"id\":\"1136\" ,\"answer\":\"5656\",\"score\":\"3\"},{\"id\":\"1137\" ,\"answer\":\"5663\",\"score\":\"5\"},{\"id\":\"1138\" ,\"answer\":\"5666\",\"score\":\"3\"},{\"id\":\"1139\" ,\"answer\":\"5670\",\"score\":\"2\"},{\"id\":\"1140\" ,\"answer\":\"5678\",\"score\":\"5\"},{\"id\":\"1141\" ,\"answer\":\"5681\",\"score\":\"3\"},{\"id\":\"1142\" ,\"answer\":\"5687\",\"score\":\"4\"},{\"id\":\"1143\" ,\"answer\":\"5690\",\"score\":\"2\"},{\"id\":\"1144\" ,\"answer\":\"5696\",\"score\":\"3\"},{\"id\":\"1145\" ,\"answer\":\"5703\",\"score\":\"5\"},{\"id\":\"1146\" ,\"answer\":\"5705\",\"score\":\"2\"},{\"id\":\"1147\" ,\"answer\":\"5711\",\"score\":\"3\"},{\"id\":\"1148\" ,\"answer\":\"5718\",\"score\":\"5\"},{\"id\":\"1149\" ,\"answer\":\"5719\",\"score\":\"1\"},{\"id\":\"1150\" ,\"answer\":\"5727\",\"score\":\"4\"},{\"id\":\"1151\" ,\"answer\":\"5731\",\"score\":\"3\"},{\"id\":\"1152\" ,\"answer\":\"5735\",\"score\":\"2\"},{\"id\":\"1153\" ,\"answer\":\"5743\",\"score\":\"5\"},{\"id\":\"1154\" ,\"answer\":\"5746\",\"score\":\"3\"},{\"id\":\"1155\" ,\"answer\":\"5752\",\"score\":\"4\"},{\"id\":\"1156\" ,\"answer\":\"5755\",\"score\":\"2\"},{\"id\":\"1157\" ,\"answer\":\"5763\",\"score\":\"5\"},{\"id\":\"1158\" ,\"answer\":\"5765\",\"score\":\"2\"},{\"id\":\"1159\" ,\"answer\":\"5771\",\"score\":\"3\"},{\"id\":\"1160\" ,\"answer\":\"5778\",\"score\":\"5\"},{\"id\":\"1161\" ,\"answer\":\"5781\",\"score\":\"3\"},{\"id\":\"1162\" ,\"answer\":\"5787\",\"score\":\"4\"},{\"id\":\"1163\" ,\"answer\":\"5790\",\"score\":\"2\"},{\"id\":\"1164\" ,\"answer\":\"5798\",\"score\":\"5\"},{\"id\":\"1165\" ,\"answer\":\"5801\",\"score\":\"3\"},{\"id\":\"1166\" ,\"answer\":\"5805\",\"score\":\"2\"},{\"id\":\"1167\" ,\"answer\":\"5812\",\"score\":\"4\"},{\"id\":\"1168\" ,\"answer\":\"5816\",\"score\":\"3\"},{\"id\":\"1169\" ,\"answer\":\"5823\",\"score\":\"5\"},{\"id\":\"1170\" ,\"answer\":\"5825\",\"score\":\"2\"},{\"id\":\"1171\" ,\"answer\":\"5832\",\"score\":\"4\"},{\"id\":\"1172\" ,\"answer\":\"5836\",\"score\":\"3\"},{\"id\":\"1173\" ,\"answer\":\"5840\",\"score\":\"2\"},{\"id\":\"1174\" ,\"answer\":\"5847\",\"score\":\"4\"},{\"id\":\"1175\" ,\"answer\":\"5851\",\"score\":\"3\"},{\"id\":\"1176\" ,\"answer\":\"5855\",\"score\":\"2\"},{\"id\":\"1177\" ,\"answer\":\"5861\",\"score\":\"3\"},{\"id\":\"1178\" ,\"answer\":\"5868\",\"score\":\"5\"},{\"id\":\"1179\" ,\"answer\":\"5869\",\"score\":\"1\"},{\"id\":\"1180\" ,\"answer\":\"5876\",\"score\":\"3\"},{\"id\":\"1181\" ,\"answer\":\"5880\",\"score\":\"2\"},{\"id\":\"1182\" ,\"answer\":\"5887\",\"score\":\"4\"},{\"id\":\"1183\" ,\"answer\":\"5890\",\"score\":\"2\"},{\"id\":\"1184\" ,\"answer\":\"5898\",\"score\":\"5\"},{\"id\":\"1185\" ,\"answer\":\"5900\",\"score\":\"2\"},{\"id\":\"1186\" ,\"answer\":\"5906\",\"score\":\"3\"},{\"id\":\"1187\" ,\"answer\":\"5910\",\"score\":\"2\"},{\"id\":\"1188\" ,\"answer\":\"5918\",\"score\":\"5\"},{\"id\":\"1189\" ,\"answer\":\"5921\",\"score\":\"3\"},{\"id\":\"1190\" ,\"answer\":\"5928\",\"score\":\"5\"},{\"id\":\"1191\" ,\"answer\":\"5930\",\"score\":\"2\"},{\"id\":\"1192\" ,\"answer\":\"5936\",\"score\":\"3\"},{\"id\":\"1193\" ,\"answer\":\"5940\",\"score\":\"2\"},{\"id\":\"1194\" ,\"answer\":\"5948\",\"score\":\"5\"},{\"id\":\"1195\" ,\"answer\":\"5950\",\"score\":\"2\"},{\"id\":\"1196\" ,\"answer\":\"5957\",\"score\":\"4\"},{\"id\":\"1197\" ,\"answer\":\"5961\",\"score\":\"3\"},{\"id\":\"1198\" ,\"answer\":\"5965\",\"score\":\"2\"},{\"id\":\"1199\" ,\"answer\":\"5973\",\"score\":\"5\"},{\"id\":\"1200\" ,\"answer\":\"5975\",\"score\":\"2\"},{\"id\":\"1201\" ,\"answer\":\"5982\",\"score\":\"4\"},{\"id\":\"1202\" ,\"answer\":\"5985\",\"score\":\"2\"},{\"id\":\"1203\" ,\"answer\":\"5993\",\"score\":\"5\"},{\"id\":\"1204\" ,\"answer\":\"5995\",\"score\":\"2\"},{\"id\":\"1205\" ,\"answer\":\"6001\",\"score\":\"3\"},{\"id\":\"1206\" ,\"answer\":\"6005\",\"score\":\"2\"},{\"id\":\"1207\" ,\"answer\":\"6013\",\"score\":\"5\"},{\"id\":\"1208\" ,\"answer\":\"6016\",\"score\":\"3\"},{\"id\":\"1209\" ,\"answer\":\"6020\",\"score\":\"2\"},{\"id\":\"1210\" ,\"answer\":\"6027\",\"score\":\"4\"},{\"id\":\"1211\" ,\"answer\":\"6031\",\"score\":\"3\"},{\"id\":\"1212\" ,\"answer\":\"6035\",\"score\":\"2\"},{\"id\":\"1213\" ,\"answer\":\"6042\",\"score\":\"4\"},{\"id\":\"1214\" ,\"answer\":\"6048\",\"score\":\"5\"},{\"id\":\"1215\" ,\"answer\":\"6049\",\"score\":\"1\"},{\"id\":\"1216\" ,\"answer\":\"6055\",\"score\":\"2\"},{\"id\":\"1217\" ,\"answer\":\"6061\",\"score\":\"3\"},{\"id\":\"1218\" ,\"answer\":\"6065\",\"score\":\"2\"},{\"id\":\"1219\" ,\"answer\":\"6071\",\"score\":\"3\"},{\"id\":\"1220\" ,\"answer\":\"6074\",\"score\":\"1\"},{\"id\":\"1221\" ,\"answer\":\"6080\",\"score\":\"2\"}]\",\"Score\":\"428\",\"StartDate\":\"2016-01-04 18:00:00.000\"}",

    LAST);

         return 0;
    }
    但是回放日志提示有错误,数据也没有传进去

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

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

    使用道具 举报

  • TA的每日心情
    奋斗
    2016-1-7 23:17
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    2#
    发表于 2016-1-7 22:47:07 | 只看该作者
    1、确定这个Body是你纯录制的,还是有手工修改什么地方,修改了的话,哪就检查修改的地方
    2、问请求开发,是否对同一用户做了唯一性判定,不允许重复提交

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 恭喜您获得了测试积点10

    查看全部评分

    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
    发表于 2016-1-14 16:42:10 | 只看该作者
    这个问题我也遇到了后来解决了。感觉是直接在body里写入json报文会有这个问题,我的方法是通过 sprintf(buffer,"%s",报文)先拼装一下,打印一下 查看发送的json是否正确,然后报文有中文字段时转一下UTF-8码,再从body里面发出去就OK了 希望对你有帮助~
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-11-26 05:04 , Processed in 0.067795 second(s), 26 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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