- 下載plugins-manager.jar
- 將下載完的JAR丟到lib/ext(libexec/lib/ext)
- 重開jemeter
- 以後options裡面會有icon
- 先確認DB的驅動是否在jmeter的lib(libexec/lib)中
- 新增JDBC Connection Configuration(參數通常可參考專案中的datasource.properties)
- 新增JDBC Request(下SQL的地方)
- if
- for
- while
- 使用Docker建立openLdap
- 自訂連線資訊
- 測試query
- 測試新增
- 測試刪除
- 新增LDAP Request
- 建立 CSV Data Set Config
- 設定HTTP Cookie Manager (CSRF_TOKEN)
- 設定HTTP Header Manager (SESSION)
- CSRF_TOKEN (body)
- 用Regular Expression Extractor取出 SESSIONID
- SESSION (response headers)
- 用Regular Expression Extractor取出 X-CSRF-TOKEN
- 位置 options/function help dialog
- 舉例
- 時間 ${__time())
- 加總 ${__intSum(5, 3, result)}
${__intSum(${result}, 2)}
- 程式 ${__javaScript(邏輯, 變數名稱)}
"productTypeId": ${__javaScript(${productTypeCodeIdMap} .filter(function(ele) ele.code == '${productTypeCode}') .map(function(ele) ele.id)[0])},
- 一旦資料越來越複雜, JSON格式變的越不易閱讀及修改
- 共同檢視 降低測試與開發之間的溝通成本
- 線上編輯 異地
- 使用Google Spreadsheet
- 部署為網路應用程式 稍微修改回傳格式
- CSV、JSON 之間轉換
-
步驟
- 建立一個全新的csv當作結果log
touch /Users/chenhaoxian/Downloads/jmeter_cmd.csv
- 建立一個簡單的測試計畫
- 打開command line 視窗下指令
sh jmeter -n -t /Users/chenhaoxian/Downloads/AH.jmx -l /Users/chenhaoxian/Downloads/jmeter_cmd.csv
-
說明
- sh: linux (windows不需要)
- -n: none GUI mode
- -t: location of jmeter script
- -l: location of result file
-
執行結果
WARNING: package sun.awt.X11 not in java.desktop
Creating summariser <summary>
Created the tree successfully using /Users/chenhaoxian/Downloads/AH.jmx
Starting the test @ Thu Aug 23 23:17:34 CST 2018 (1535037454760)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary + 26 in 00:00:25 = 1.0/s Avg: 971 Min: 16 Max: 7904 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0
summary + 19 in 00:00:28 = 0.7/s Avg: 1486 Min: 10 Max: 9316 Err: 0 (0.00%) Active: 0 Started: 1 Finished: 1
summary = 45 in 00:00:54 = 0.8/s Avg: 1188 Min: 10 Max: 9316 Err: 0 (0.00%)
Tidying up ... @ Thu Aug 23 23:18:28 CST 2018 (1535037508858)
... end of run