title: How to fail a script assertion in SoapUI?
body: <p>I'm trying to let a script assertion fail, when a variable has another value than defined. My goal: Mark the TestStep as red, if the TestStep will fail.  Please note that I am using a script assertion for a TestStep - not a separate Groovy-Script TestStep.
  My script looks like this:</p>
  
  <pre><code>httpResponseHeader = messageExchange.responseHeaders
  contentType = httpResponseHeader["Content-Type"]
  log.info("Content-Type: " + contentType)
  
  if (contentType != "[image/jpeg]"){
      log.info("ERROR! Response is not an image.")
      //Script Assertion should fail.
      //TestStep should be marked red.
  } else {
      log.info("OK! ResponseType is an image.")
  }
  </code></pre>
  
  <p>Is there any way, how to let the script assertion fail depending on a property?
  I've tried to use the <em>getStatus()</em> method, but this is only available for the testrunner object. Unfortunately the testRunner-object can not be used within a script assertion concerning this post: <a href="http://forum.soapui.org/viewtopic.php?f=2&amp;t=2494#p9107" rel="nofollow">http://forum.soapui.org/viewtopic.php?f=2&amp;t=2494#p9107</a></p>