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
Newsletter
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

  • The SDLC After AI
  • Applying Microservices Lessons to Multi-Agent AI Systems
  • Avoiding AI Debt as a Team
  • Every Generation Fears the Machine. Here Is How the AI Job Panic Usually Ends

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Updated Oct. 29, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
81.7K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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