Close

November 12, 2013

Run JMeter tests in CMD prompt

JMeter utilizes more memory and resources if you add listeners to your high load test. In order to lessen the resource utilization for greater performance, you need to run JMeter tests in cmd prompt and generate the required results after the execution.

How to run JMeter tests in cmd prompt?

  1. Open command prompt
  2. Go to the folder where you installed JMeter and type below command. This executes the script in non-GUI mode.
jmeter -n -t <your_script_path.jmx>

How to generate results after the execution in JMeter?

  1. Add one more parameter to above command which stores the results in *.JTL file as shown below. 
jmeter -n -t <your_script_path.jmx>-l <path_to_store_results_file.jtl>

After testing is complete, you can find the *.jtl file in the specified path. Now launch JMeter with GUI and add any listener to WorkBench/TestPlan. You can add any listener and generate the report.

By default, JMeter do not save threads count in JTL files. If you plan to work with JMeter JTL files, you should enable it by uncommenting in JMETER-INSTALL-DIR/bin/jmeter.properties the line and set it to TRUE.

jmeter.save.saveservice.thread_counts=true

Thanks for visiting QAInsights! Check out our new portal Testifications.com to get updates on Software Testing related certifications. We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything.

Searching for QA Jobs Openings, check it at www.QAJobOpenings.com

Want to start a blog like this, please visit SpidyDomain to buy cheap web hosting and register domain.

Subscribe to our QAInsights YouTube Channel | Subscribe our free weekly newsletter

About NaveenKumar Namachivayam

Hi there! is a passionate and experienced Performance Test Analyst based in Chicago, USA with skill sets in Manual Testing, Test Automation, Performance Testing, and Test Estimation. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs: Excel Blog, DealsBrook, NaveenKumarN.in, and Affiliate Insights blog and Software Testing Memes.

2 Comments on “Run JMeter tests in CMD prompt

priyanka
April 7, 2017 at 12:49 pm

How to add listener to command to run Jmeter test using command prompt

Reply
NaveenKumar Namachivayam
April 10, 2017 at 9:35 am

Hi Priyanka,

Best way to generate report is enable only Simple Data Writer in your Test Plan and execute it from NON-GUI mode. By having this listener, you can generate any types of graphs/charts in JMeter. Hope this helps. Thanks for checking my blog. 🙂

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *