發(fā)布: 2008-9-01 09:46 |
作者: 陳雷 (Jackei) |
來(lái)源:
測試時(shí)代采編 |
查看: 597次 | 進(jìn)入軟件測試論壇討論
領(lǐng)測軟件測試網(wǎng)
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 |
上面這段說(shuō)明來(lái)自 JMeter 的官方用戶(hù)手冊。其中提到了使用命令行方式運行 JMeter 腳本的方法。只有幾個(gè)簡(jiǎn)單的參數,很直觀(guān),用起來(lái)也很方便。好處是可以節省一些系統資源。
今天嘗試 300 個(gè)虛擬用戶(hù)連續運行 5 分鐘時(shí)——使用 GUI 方式,發(fā)現開(kāi)始運行后不久 UI 就失去了響應,并提示一個(gè)有關(guān) AWT 的錯誤,最終只能把 Java 進(jìn)程結束掉。但是使用命令行方式時(shí)卻很穩定。
不過(guò)當在命令行方式下嘗試 500 個(gè)虛擬用戶(hù)連續運行 5 分鐘時(shí),JMeter 拋出了一個(gè) Out of Memory 的異常并退出了進(jìn)程。
Note:
1.執行命令前要檢查當前目錄是否是 %JMeter_Home%\bin 目錄;
2.如果 JMeter 腳本不在當前目錄,需要指定完整的路徑;如果要把執行的結果保存在其他地方也要指定完整的路徑。
文章來(lái)源于領(lǐng)測軟件測試網(wǎng) http://kjueaiud.com/
TAG:
jmeter
JMeter
腳本
命令
運行