We have seen How to Record and Run Jmeter Script already. In this article, we are going to focus on how to run the same Jmeter script in Non-GUI mode. Jmeter is a pure Java based application designed as Load Testing Tool and for efficiently doing analysis & performance measurement of Web applications or variety of services. It also provides you an option to run performance test in Non-GUI mode.
Running Jmeter in GUI mode is not advisable for test scenarios consuming heave resources and memory. Purpose is to simulate high number of concurrent users without affecting performance and avoid producing higher error rate.
Run Jmeter in Non-GUI mode through Command Line:
jmeter -n -t YourJmeterTestPlan.jmx -l TestResultFile.jtl -j LogFile.log
-n – Non-GUI mode – This specifies JMeter is to run in non-gui mode
-t – Name of JMX file that contains Test Plan
-l – Name of JTL file to capture results to
-j – Name of Log file to capture execution logs
After running this command, Jmeter instance will be initiated which will execute the JMX file mentioned after -t. Post execution it will create the Test result file with .jtl format. If a result file with same name already exist, it will be appended with new one. You can open the result file in Jmeter itself by following below mentioned simple steps:
– Open Jmeter in GUI Mode.
– Under Test Plan, add listener Eg. Aggregate Report.
– Brows the JTL file from downloaded location.
– Now you can see result of your execution loaded in Aggregate Report.
Jmeter also provides few more parameters in Non-GUI mode.
-R[List of Remote Servers] – To Run the test in specified Remote Server
-H[Proxy Server HostName or IP Address]
-P[Port number of Proxy Server]
This is how we can execute Jmeter Test script from Command line in Non-GUI mode. Let us know if you face any difficulty. Happy Testing!!