# cat log.jtl timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1574846769407,33,HTTP請求,200,OK,線程組 1-1,text,false,"Test failed: text expected to contain /""code"":10000/",161,227,1,1,http://xxxxx/image/lrr271,33,0,21
# jmeter -n -t lrr1.jmx -l log.jtl Creating summariser <summary> Created the tree successfully using lrr20mubiao1.jmx Starting the test @ Wed Nov 27 17:26:09 CST 2019 (1574846769002) Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445 summary = 1 in 00:00:00 = 5.5/s Avg: 33 Min: 33 Max: 33 Err: 1 (100.00%) Tidying up ... @ Wed Nov 27 17:26:09 CST 2019 (1574846769449) ... end of run
Body Data中的json引用的變量未加大括號$Wlinux
<stringProp name="Argument.value">{"base64":"$w"}</stringProp>
最後發現問題:json格式,上傳base64碼,Body Data中的json引用的變量必需要加大括號,{"base64":"${w}"};json
<stringProp name="Argument.value">{"base64":"${w}"}</stringProp>
最後執行成功編碼
# jmeter -n -t lrr20mubiao1.jmx -l log.jtl Creating summariser <summary> Created the tree successfully using lrr20mubiao1.jmx Starting the test @ Wed Nov 27 17:39:00 CST 2019 (1574847540263) Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445 summary + 1 in 00:00:01 = 1.9/s Avg: 368 Min: 368 Max: 368 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0 summary = 1 in 00:00:01 = 1.9/s Avg: 368 Min: 368 Max: 368 Err: 0 (0.00%) Tidying up ... @ Wed Nov 27 17:39:01 CST 2019 (1574847541089) ... end of run
總結:上傳base64碼,body中引用變量,必須加大括號{};可是上傳文字未加大括號也是能夠的spa
2.body中帶漢字,必定加編碼utf-8,不然報參數不合法。線程