1
votes

I am running my jmeter tests using Jenkins and maven-jmeter plugin. My pom.xml is configured as below.

 <testFilesIncluded>
      <jMeterTestFile>001-Test1.jmx</jMeterTestFile>
      <jMeterTestFile>002-Test2.jmx</jMeterTestFile>
      <jMeterTestFile>003-Test3.jmx</jMeterTestFile>
      <jMeterTestFile>004-Test4.jmx</jMeterTestFile>
       <jMeterTestFile>005-Test5.jmx</jMeterTestFile>
 </testFilesIncluded>

Also, using performance plugin in jenkins for reporting.

So if my first test (001-Test1.jmx) fails (assertions fail), i do not want to execute the next test (002-Test2.jmx).

How can i accomplish this ? Thanks for your help in advance.

2
Not sure if ignoreResultsFailures is what you need. It is set to false by default - if you didn't override it in your pom. I don't think it will do the job if you save results in CSV format, but may work for you if you save results to XML/JTL. I'm sorry, you'd have t oconfirm if it works for you. I don't remember at which stage this will halt the execution. - automatictester

2 Answers

0
votes

I'm not sure if that helps,

but if you used TestNG you could make sure a certain number of test methods have completed and succeeded before running more test methods by setting the dependencies in testng.xml

 <test name="My suite">
  <groups>
    <dependencies>
      <group name="c" depends-on="a  b" />
      <group name="z" depends-on="c" />
    </dependencies>
  </groups>
</test>

Hope you can make some use of it.

0
votes

Using ant, you can define different Jmeter tests as separate targets and set up dependencies between them. That's exactly what you need. Remember that maven describes the structure of your project, not the logic of its execution (if-then). But ant does. So, try to switch to ant.