EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials JMeter Tutorial JMeter Command Line 
Secondary Sidebar
JMeter Tutorial
  • JMeter Basic and Advanced
    • What is Jmeter
    • Install Jmeter
    • JMeter API Testing
    • JMeter if controller
    • JMeter JSON Extractor
    • JMeter Recording
    • JMeter CSV Data Set Config
    • JMeter Command Line
    • JMeter Report
    • JMeter HTTP Request
    • JMeter While Controller
    • JMeter with Selenium
    • JMeter Script
    • JMeter Constant Throughput Timer
    • JMeter Random Variable
    • JMeter tool
    • JMeter BlazeMeter
    • JMeter Parameters
    • JMeter Plugins
    • JMeter Performance Testing
    • JMeter load testing
    • JMeter BeanShell
    • JMeter User-Defined Variables
    • JMeter WebSocket
    • JMeter Aggregate Report
    • JMeter Distributed Testing
    • JMeter Summary Report
    • JMeter Response Assertion
    • JMeter Assertion
    • JMeter Thread Group
    • JMeter Loop Count
    • JMeter Variables
    • JMeter Testing
    • JMeter Version
    • Timers in Jmeter
    • JMeter Alternatives
    • JMeter Command Line Options
    • JMeter Ramp Up Period
    • JMeter Plugin Manager
    • JMeter Throughput
    • JMeter Regular Expression Extractor

JMeter Command Line 

JMeter Command Line

Introduction to JMeter Command Line

JMeter is an open-source tool used to perform load and performance testing on the application. There are two ways to use JMeter: the graphical user interface and command line mode. JMeter provides different functionality when we use command line mode, such as we can generate the CSV or say that the XML file consists of the output of test execution. In other words, we can say that it stores the result of the HTML report. Normally JMeter, by default, provides the summary of load testing after the execution as well as we can also see the real-time output of test execution as per our requirements.

What is the JMeter Command-Line?

Apache JMeter is an open-source testing application. JMeter capacities to examine and gauge the presentation of web applications with an assortment of different administrations. In addition, the GUI method of JMeter is ideal for adding and altering new arrangement components, string gatherings, and samplers, which allows you to see various audience members helping with troubleshooting.

Nonetheless, the GUI mode has a constraint that dials back the CPU while running the recorded content. Assuming we are running different audience members in content, it influences the JMeter execution. The content should be run in non-GUI mode to defeat such a circumstance. There is an advantage to driving more demands each second out of JMeter in non-GUI mode.

A command-line interface (CLI) processes orders to a PC program as lines of text. The program that handles the connection point is an order line translator or order line processor.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Working frameworks execute an order line interface in a shell for intelligent admittance to working framework capacities or administrations.

We will execute the JMeter Tests in Non-GUI mode. However, before that, we want to comprehend why we want to execute the Test In Non-GUI mode.

Typically when we execute the Request in the Non-GUI Mode, it will send a few solicitations to the server and get the reaction, and again it will require some investment to produce the reports and view the outcomes to the client. So it will interact with the UI of some sort or another Level.

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,560 ratings)

So we cannot get the Actual outcome when we send the solicitation and help a reaction through UI. So we run the JMeter Test in order briefly to keep away from that circumstance.

Now let’s see why we need to use command line mode.

  • Expanding strings (after a specific limit) because of which JMeter crashes in the GUI mode.
  • For serious test situations (ex: shopping application: login-view item put on truck view tab eliminate item take care of bill), JMeter consumes memory and CPU, which might influence your experimental outcomes.
  • To build JMeter capacities, for example, to get more demands each second.

How to Run JMeter Command-Line?

Now let’s see how we can run JMeter on command line mode.

First, we need to open the command line prompt window, as shown in the following screenshot.

Command line prompt Window

In the second step, we need to go into the bin folder of JMeter. After that, we need to enter the command,

JMeter -n –t test.jmx -l testresults.jtl

We need to set the different parameters in the above command as follows.

  • n is used to specify the JMeter run test into a non-GUI mode that is command line mode.
  • t Is used to specify the name of the JMX file that contains the plan of a test, and it depends on the user.
  • l It is used to specify the name of the JMeter text log file and consists of the log result.
  • j It is used to specify the name of JMeter log files.

After executing the above command, we see the generated result in the specified location in CSV format; here, we can add any listener as per our requirement, but we need to open JMeter into a GUI mode for that purpose.

JMeter Command Line Configuration

Now let’s see how we can configure the command line mode of JMeter as follows.

In the above point, we already discussed how to run the JMeter command line mode, but if we want to run JMeter for distributed testing, we need to do some settings on our local machine.

  1. First, we need to ensure we installed the updated version of JMeter.
  2. After that, we need to make some changes to the JMeter properties file for IPs and slaves; in this step, we also ensure the master and slave are located on the same subnet.
  3. Now we need to execute the JMeter server on every slave, so for that purpose, we need to execute the bat file of JMeter from the bin folder.
  4. Report generation and reaming all things are the same.

Example of JMeter Command Line

Now let’s see the example for better understanding as follows.

First, we need to add the test plan into the JMeter, as shown in the following screenshot.

JMeter Command Line Example 1

We need to add the listener to view the output, as shown in the following screenshot.

Add listener Example 2

Now save the test plan, minimize the current window and execute the below-mentioned command.

JMeter -n -t D:\Software\apache-JMeter-5.4.1\apache-JMeter-5.4.1\bin\ View Results Tree.jmx -l D:\Software\apache-JMeter-5.4.1\apache-JMeter-5.4.1\bin\result.csv

Explanation

In the above command, we specify all parameters such as the name of the test plan, location of the test plan, where we need to store the result of the test plan, etc. Then, we can make the changes in the above command as per our requirements. We illustrated the final output of the above command by using the following screenshot.

JMeter Command Line Example 3

After executing the above command, the CSV file generated, as shown below, is as follows.

CSV file Example 4

Now we need to open that file to see the output of the test plan, as shown in the following screenshot.

JMeter Command Line Example 5

Conclusion

We hope from this article you learn more about the JMeter command line. From the above article, we have taken in the essential idea of the JMeter command line and see the representation and example of the JMeter command line. Furthermore, this article taught us how and when to use the JMeter command line.

Recommended Articles

This is a guide to JMeter Command-Line. Here we discuss the definition and how to run and configure JMeter Command-Line along with the example. You may also look at the following articles to learn more –

  1. Python Command-line Arguments
  2. JMeter Version
  3. Postgres Command-Line
  4. JMeter Alternatives
Popular Course in this category
JMeter Testing Training (3 Courses)
  3 Online Courses |  9+ Hours |  Verifiable Certificate of Completion |  Lifetime Access
4.5
Price

View Course
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more