1
我不知道如何讓JMeter生成特定請求並等待特定響應。任何人都可以幫我嗎? 我正在測試Web應用程序。有數據計算的具體工作。 在我的情況下,當我運行一個工作,在用戶界面上顯示進度條,每秒我都得到中間服務器響應。 作業計算時間可能需要長達1-2小時。JMeter如何生成特定請求並等待具體響應
提交
• 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"}}
CHECK
然後,我需要從響應得到「位置」,並保持在要求張貼位置字符串 檢查每一秒左右
• 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}]}