title: How to get an overall PASS/FAIL result for a JMeter thread group
body: <p>How can I get an overall PASS/FAIL result for a JMeter thread group without using a post processor on every sampler?</p>
  
  <p>I've tried using a beanshell listener, but it doesn't work for instances where there are multiple samplers inside a transaction controller with "Generate Parent Sample" enabled. In that case, the listener only gets called once per transaction controller and I'm only able to access the result of the last sampler inside the transaction controller.</p>
  
  <p>Edit:</p>
  
  <p>I would like to be able to save a pass/fail value as Jmeter variable or property for the thread group. If one or more components of the thread group fail or return an error, then that would be an overall fail. This variable will then be used for reporting purposes. </p>
  
  <p>My current beanshell listener code:</p>
  
  <pre><code>SampleResult sr = ctx.getPreviousResult();
  
  log.info(Boolean.toString(sr.isSuccessful()));
  
  if (!sr.isSuccessful()){
      props.put("testPlanResult", "FAIL");
  
      testPlanResultComment = props.get("testPlanResultComment");
  
      if(testPlanResultComment == ""){
              testPlanResultComment = sr.getSampleLabel();
      }else {
              testPlanResultComment = testPlanResultComment + ", " + sr.getSampleLabel();
      }
  
      props.put("testPlanResultComment", testPlanResultComment);
      log.info(testPlanResultComment);
  }
  </code></pre>