0%

How to create Jmeter Report

How to Create Basic Test and Report

Add Thread Group

  1. click Right mouse button on side bar ‘Test Plan’
  2. Add > Threads(Users) > Thread Group

Edit Thread Group Setting

  1. Number of Threads (users):執行緒數量,相當於使用者數量
  2. Ramp-up period (seconds):該時間內啟動完所有的執行緒
  3. Loop Count:上述兩樣的設定值,執行的重複次數

Add Http Request

  1. click Right mouse button on side bar ‘Thread Group’
  2. Add > Sampler > HTTP Request

Edit Http Request

  1. Protocol [http]:通訊協定 以 http 與 https

  2. Server Name or IP:主機名稱或 IP 位置

  3. HTTP Method:可以透過下拉式選單來選擇所用的 method

  4. Path:路徑

    sample

     Protocol[http] : "https"
    Server Name or IP: "www.google.com"
     HTTP Method: GET
     Path: "/search?         q=shopline&ei=XoUfYYG8ObK1mAWXjavQCw&oq=shopline&gs_lcp=Cgdnd3Mtd2l6EAMyDgguEIAEEMcBEK8BEJMCMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEOgcIABBHELADOgcIABCwAxBDOgQIABBDOgsILhCABBDHARCjAjoFCAAQkQI6CwguEIAEEMcBENEDOgUILhCABDoLCC4QgAQQxwEQrwE6DQguEMcBEKMCEEMQkwI6CgguEMcBENEDEENKBAhBGABQ0I87WMaVO2DOlztoA3ACeACAAa4BiAH8B5IBAzIuN5gBAKABAcgBCsABAQ&sclient=gws-wiz&ved=0ahUKEwiB48_Gs7_yAhWyGqYKHZfGCroQ4dUDCA4&uact=5"
    

    Path use search “Shopline”?>

Add Results Tree Report

  1. Click Right mouse button on side bar ‘Thread Group’
  2. Add > Listener > View Results Tree

Add Aggregate Report Report

  1. Click Right mouse button on side bar ‘Thread Group’
  2. Add > Listener > Aggregate Report

Start Test

  1. Click Star button Run Test Plan above the toolbar

View Test Results

  1. Clcik ‘View Results Tree’ can view report

Aggregate Report

  1. Click ‘Aggregate Report’ can view report
1
2
3
4
5
6
7
8
9
10
11
12
Samples:發送請求筆數
Average:平均回應時間
Median:回應時間的中間值
90% Line:百分之 90 的最高回應時間
95% Line:百分之 95 的最高回應時間
99% Line:百分之 99 的最高回應時間
Min:回應時間的最小值
Maximum:回應時間的最大值
Error %:執行的錯誤率
Throughput:吞吐量
Received KB/sec:下載速率
Sent KB/sec:上傳速率

Generate Report

  1. I got .jmx in GUI
    example ‘bobtest.jmx’

  2. create folder Name ‘folderName’

sh jmeter -n -t <bobtest.jmx>.jmx -l <resultName>.jtl -e -o /<folderName>

1
2
3
4
5
-n:以非 GUI 的方式執行 JMeter,也就是以 CLI 進行操作
-t:執行測試腳本的路徑,副檔名為 .jmx (testScript.jmx)
-l:記錄測試結果的檔案路徑與名字,副檔名為 .jtl (testResult.jtl)
-e:測試腳本執行完後產生 html 報告
-o:測試腳本 html 報告的資料夾,資料夾必須不存在 (ReportFolder)

If got this error message ‘ An error occurred: Cannot write to ‘/‘ as folder is not empty’
try -f
``sh jmeter -n -t <bobtest.jmx>.jmx -l .jtl -e -o -f /`

If got An error occurred: Cannot write to '/folderName' as folder does not exist and parent folder is not writable
please, create folder ‘folderName’

After execution the commaned, can find the index.html file in folderName