發布: 2008-9-01 09:46 |
作者: 陳雷 (Jackei) |
來源:
測試時代采編 |
查看: 597次 | 進入軟件測試論壇討論
領測軟件測試網
2.4.3 Non-GUI Mode (Command Line mode) |
For non-interactive testing, you may choose to run JMeter without the GUI. To do so, use the following command options
-n This specifies JMeter is to run in non-gui mode
-t [name of JMX file that contains the Test Plan].
-l [name of JTL file to log sample results to].
-r Run all remote servers specified in JMeter.properties (or remote servers specified on command line by overriding properties)
The script also lets you specify the optional firewall/proxy server information:
-H [proxy server hostname or ip address]
-P [proxy server port]
Example : JMeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000 |
上面這段說明來自 JMeter 的官方用戶手冊。其中提到了使用命令行方式運行 JMeter 腳本的方法。只有幾個簡單的參數,很直觀,用起來也很方便。好處是可以節省一些系統資源。
今天嘗試 300 個虛擬用戶連續運行 5 分鐘時——使用 GUI 方式,發現開始運行后不久 UI 就失去了響應,并提示一個有關 AWT 的錯誤,最終只能把 Java 進程結束掉。但是使用命令行方式時卻很穩定。
不過當在命令行方式下嘗試 500 個虛擬用戶連續運行 5 分鐘時,JMeter 拋出了一個 Out of Memory 的異常并退出了進程。
Note:
1.執行命令前要檢查當前目錄是否是 %JMeter_Home%\bin 目錄;
2.如果 JMeter 腳本不在當前目錄,需要指定完整的路徑;如果要把執行的結果保存在其他地方也要指定完整的路徑。
文章來源于領測軟件測試網 http://www.kjueaiud.com/
TAG:
jmeter
JMeter
腳本
命令
運行