0

I want to run jmeter script(test.jmx) through jenkins with Maven or Ant, can anybody help me out on this. I don't have much knowledge of maven/ant so can anyone please provide me the exact steps which I need to perform to do this activity?

I have integrated performance plugin for jmeter reports as well.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Shekhar
  • 1
  • 2

3 Answers3

1

Have you tried looking over the web prior to asking?

  • JMeter Ant Task - for Ant. Besides under extras folder of your JMeter installation there is build.xml file which is Ant configuration file you can use as a template
  • JMeter Maven Plugin - for Maven.

If you have freedom to choose, you may even go for simple non-GUI command-line execution. If you use Performance Plugin you may have to pass an additional argument to force JMeter to store its results in XML format like:

jmeter -Jjmeter.save.saveservice.output_format=xml -n -t testplan.jmx -l results.jtl

See Five Ways To Launch a JMeter Test without Using the JMeter GUI article for overview of aforementioned and other JMeter test unattended execution options.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I know it might not be related to this question. Could you please help me on this -> https://stackoverflow.com/questions/68234661/how-to-email-html-report-of-jmeter-execution-via-jenkins-the-one-which-we-get-us – QA-Palash Jul 03 '21 at 09:53
0

As Dmitri has suggested, you really don't need Maven or Ant to run JMeter scripts from Jenkins. A simpler alternative is to create a batch file for executing JMeter scripts and then run that batch file via Jenkins.

Steps will be like this (assuming you have not setup Jenkins):

  1. Create batch file for Jmeter script (refer to Dmitri comment and Link)
  2. Install & configure Jenkins (yakiloo . com/setup-jenkins-and-windows/)
  3. Call the batch file through Jenkins. You can find many threads on how to run a batch file via Jenkins. (Run batch command in jenkins)
Community
  • 1
  • 1
TestingWithArif
  • 894
  • 2
  • 13
  • 19
0

Even though you really do not need Ant/Maven, It is good to run JMeter tests through Ant. Because you will end up creating a batch file for your requirement - running the test, creating HTML report and charts etc from the result file.

For detailed steps on using Ant for Jmeter tests, I would advise you to check this site: http://www.testautomationguru.com/jmeter-continuous-performance-testing-part1/

vins
  • 15,030
  • 3
  • 36
  • 47