asgher
asgher

Reputation: 46

Run Jmeter in non GUI Mode from Gradle Jmeter Plugin

Context: Right now I am using jmeter gradle plugin from Kulya. But I need to generate graphical results, so I used jmeter plugins..but I need to run this using command prompt and cannot run using gradle jmeter plugin.

Earlier:

 jmeterRun.configure {
               srcDir = file('src/test/performance/jmeter/')
               jmeterTestFiles = [file('src/test/performance/jmeter/<MY_FILE>.jmx')]
           }

Now I need to run like this:

jmeter.bat -t <MY_FILE>.jmx -n -l /data/jmeter/concurrent/concurrent-test-results.csv

The problem is,I am not able to execute this command using jmeter gradle plugin.specifically pass the parameters like -n -l using jmetr gradle plugin.

Upvotes: 2

Views: 2566

Answers (2)

djangofan
djangofan

Reputation: 29689

I created a GitHub project, as a template, with all of this setup. It is configured so that developers can launch jmeter from a Git repository and each developer thus shares the same Jmeter with the exact same capabilities/libraries.

It doesn't solve your issue of easily passing parameters, but it looks like the other suggestion of using external properties files will probably work.

Upvotes: 1

CharlieS
CharlieS

Reputation: 1452

You can configure save results file in user properties, then include the properties file in gradle config using jmeterUserPropertiesFiles

To start jmeter in non-gui via gradle, you use:

gradle jmeterRun

Upvotes: 1

Related Questions