【发布时间】:2015-04-22 17:21:17
【问题描述】:
我不知道如何让 JMeter 生成特定的请求并等待特定的响应。谁能帮助我? 我正在测试网络应用程序。数据计算有特定的工作。 就我而言,当我运行作业时,在 UI 上会显示进度条,并且每秒我都会收到中间服务器响应。 作业计算时间可能需要 1-2 小时。
提交
• REQUEST:
o POST POST "https:/myserver/web/api/datasets/684/cluster?viz-id=9242"
with payload in json: {"dbType":"unit","columnName":"Type", "version":0,"useWeight":false, "weightColumnName":"", "useWeightAsAttribute":false, "extraAttributes":9, "ignoreColumns":[]}
• RESPONSE:
o {"message":"Ok","result":{"location":"http:/localhost:8000/async/result/340"}}
检查
然后我需要从响应中获取“位置”,并通过发布位置字符串每隔一秒左右检查一次 在请求中
• REQUEST:
o "https:/myserver/web/api/datasets/job-status"
with payload as string "http:/localhost:8000/async/result/340"
• RESPONSE:
o {"message":"Ok","result":{"jobId":"340","status":"IN_PROGRESS","taskList":[]}}
并继续检查,直到我得到 cacheId 作为响应
• REQUEST:
o POST "https:/myserver/web/api/datasets/job-status
with payload as string "http:/localhost:8000/async/result/340"
• RESPONSE:
o {"message":"Ok","result":{"colimp_data":"web-340.colimp.data","cacheId":1184}}
得到结果
现在解析最后一个响应以获取缓存 id 并生成另一个 http 请求
• REQUEST:
o GET http:/myserver/web/api/cache/1184/colimp_data
• RESPONSE:
o {"columnName":"Type","columns":[
{"column":"sepalWidth","importance":93.13}]}
【问题讨论】:
标签: jmeter