Using Commandline Parameters in JMeter | Loadium

Using Commandline Parameters in JMeter

It is a common practice to create performance test scripts by using JMeter GUI. For test execution however, it would be best to use command…

Using Commandline Parameters in JMeter

It is a common practice to create performance test scripts by using JMeter GUI. For test execution however, it would be best to use command line mode of JMeter. So whenever you need to change a parameter like thread number, base url, etc.. you need to go to GUI mode, do some 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 Argument via Command Line

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 by built-in function of JMeter. This function is ${__P(VariableName)}

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

How to Pass Argument via Loadium

When you want to run your tests in Loadium, you can use 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 jmx file.

You can reach the original artical and more in https://loadium.com/blog/using-commandline-parameters-in-jmeter/

Happy load testing…

Latest articles

All Articles →

Craft Powerful Performance Tests with Ease Loadium Script Builder

Craft Powerful Performance Tests with Ease Loadium Script Builder

What Is Shift Left Testing

What Is Shift Left Testing

Swagger vs Postman What Are the Differences

Swagger vs Postman What Are the Differences