1. 程式人生 > >Jmeter系列(5)- jmeter.properties常用配置項講解

Jmeter系列(5)- jmeter.properties常用配置項講解

如果你想從頭學習Jmeter,可以看看這個系列的文章哦

https://www.cnblogs.com/poloyy/category/1746599.html

 

jmeter.properties

所在目錄: E:\apache-jmeter-5.2.1\bin ,jmeter安裝目錄下的bin目錄

是Jmeter核心配置項檔案

 

官方建議

將需要修改的屬性值,複製貼上到同目錄下的 user.properties 

好處:當Jmeter升級時,可以避免修改項需要重新應用

 

常用的配置

官方文件:https://jmeter.apache.org/usermanual/properties_reference.html

預設語言設定

  • language=en:預設英文
  • language=zh_CN:預設中文
 

配置預設編碼格式

  • sampleresult.default.encoding=ISO-8859-1:預設ISO-8859-1
  • sampleresult.default.encoding=UTF-8:可以改成常用的UTF-8

 

輸出測試報告模板格式 

jmeter.save.saveservice.output_format=csv

 

捕捉cookie

Cookies應該儲存為變數

CookieManager.save.cookies=false:預設

CookieManager.save.cookies=true:將cookie儲存為變數

 

快捷方式(ctrl+數字0-9)

  • gui.quick_0=ThreadGroupGui
  • gui.quick_1=HttpTestSampleGui
  • gui.quick_2=RegexExtractorGui
  • gui.quick_3=AssertionGui
  • gui.quick_4=ConstantTimerGui
  • gui.quick_5=TestActionGui
  • gui.quick_6=JSR223PostProcessor
  • gui.quick_7=JSR223PreProcessor
  • gui.quick_8=DebugSampler
  • gui.quick_9=ViewResultsFullVisualizer

 

post請求,若不新增Content-Type,則不會預設新增Content-type

在5.0版本之前預設是true

post_add_content_type_if_missing=false:預設

post_add_content_type_if_missing=true:新增Content-Type: application/x-www-form-urlencoded

 

配置遠端主機 host 

remote_hosts=127.0.0.1

    後面有哪些會用到我再加上哦

&n