How to Create Basic Test and Report
Add Thread Group
- click Right mouse button on side bar ‘Test Plan’
- Add > Threads(Users) > Thread Group
Edit Thread Group Setting
- Number of Threads (users):執行緒數量,相當於使用者數量
- Ramp-up period (seconds):該時間內啟動完所有的執行緒
- Loop Count:上述兩樣的設定值,執行的重複次數
Add Http Request
- click Right mouse button on side bar ‘Thread Group’
- Add > Sampler > HTTP Request
Edit Http Request
Protocol [http]:通訊協定 以 http 與 https
Server Name or IP:主機名稱或 IP 位置
HTTP Method:可以透過下拉式選單來選擇所用的 method
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
- Click Right mouse button on side bar ‘Thread Group’
- Add > Listener > View Results Tree
Add Aggregate Report Report
- Click Right mouse button on side bar ‘Thread Group’
- Add > Listener > Aggregate Report
Start Test
- Click Star button Run Test Plan above the toolbar
View Test Results
- Clcik ‘View Results Tree’ can view report
Aggregate Report
- Click ‘Aggregate Report’ can view report
1 | Samples:發送請求筆數 |
Generate Report
I got .jmx in GUI
example ‘bobtest.jmx’create folder Name ‘folderName’
sh jmeter -n -t <bobtest.jmx>.jmx -l <resultName>.jtl -e -o /<folderName>
1 | -n:以非 GUI 的方式執行 JMeter,也就是以 CLI 進行操作 |
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