DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • 7 Techniques That Supercharged My Claude-Assisted Development
  • Beyond Request-Response: Architecting Stateful Agentic Chatbots with the Command and State Patterns
  • From Load Testing to Performance Engineering: Why the Shift Matters
  • A Beginner's Guide to Docker Compose

Trending

  • Securing the AI Host: Spring AI MCP Server Communication With API Keys
  • Why Round-Robin Won't Save You: Load Balancing Challenges in Data Streaming Services With Heterogeneous Traffic
  • When One MVP Is Really Four Systems: A Better Way to Plan Multi-Role Apps
  • Jakarta EE 12: Entering the Data Age of Enterprise Java
  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Using Command Line Parameters in JMeter for Load Testing

Using Command Line Parameters in JMeter for Load Testing

Learn how to create performance test scripts using the command line mode in JMeter.

By 
Canberk Akduygu user avatar
Canberk Akduygu
·
Updated Oct. 29, 18 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
81.5K Views

Join the DZone community and get the full member experience.

Join For Free

It is a common practice to create performance test scripts by using the JMeter GUI. For test execution, however, it would be best to use the command line mode of JMeter. Whenever you need to change a parameter, like thread number, base URL, etc., you need to go to GUI mode, make modifications, and run your test. We can’t call that a good practice. JMeter lets you pass parameters in command line mode.

How to Pass an Argument via the Command Line

A basic command line parameter is

jmeter -n -t your_script.jmx
  • -n — tells JMeter to run in non-GUI mode.
  • -t — specifies the path to source .jmx script to run.

In case you want to send parameters via command line, add the parameters below:

jmeter -n -t your_script.jmx -Jurl=www.abcdef.com -Jusername=canberk

Then you need to change your JMeter file. You can receive these parameters with a built-in function of JMeter. This function is ${__P(VariableName)}.

This way, your test scripts are going to be dynamic in terms of parametrization.

How to Pass an Argument via Loadium

When you want to run your tests in Loadium, you can use the Advanced Settings tab in Create JMeter Test. Then you can add the necessary parameters. As a result, you don’t need to re-upload your scripts everytime you change something in the jmx file.

Happy load testing…


Please feel free to ask questions if you have any.

Command (computing) Load testing

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • 7 Techniques That Supercharged My Claude-Assisted Development
  • Beyond Request-Response: Architecting Stateful Agentic Chatbots with the Command and State Patterns
  • From Load Testing to Performance Engineering: Why the Shift Matters
  • A Beginner's Guide to Docker Compose

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook