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 Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  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.

Canberk Akduygu user avatar by
Canberk Akduygu
·
Oct. 29, 18 · Tutorial
Like (3)
Save
Tweet
Share
75.35K 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.

Popular on DZone

  • 9 Ways You Can Improve Security Posture
  • 2023 Software Testing Trends: A Look Ahead at the Industry's Future
  • How to Deploy Machine Learning Models on AWS Lambda Using Docker
  • Best Practices for Writing Clean and Maintainable Code

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: