title: Unable to run groovy script with jmeter
body: <p>My code to assert response :</p>
  
  <pre><code>import groovy.json.JsonSlurper
  
  sleep(5000)
  def ResponseMessage = messageExchange.response.responseContent
  def jsonString = new JsonSlurper().parseText(ResponseMessage)
  
  
  assert !(jsonString.isEmpty())
  assert jsonString.code == 200
  </code></pre>
  
  <p>Error from Jmeter :</p>
  
  <pre><code>&gt; 2017/05/15 21:37:20 ERROR - jmeter.timers.JSR223Timer: Problem in
  &gt; JSR223 script JSR223 Timer javax.script.ScriptException:
  &gt; javax.script.ScriptException: groovy.lang.MissingPropertyException: No
  &gt; such property: messageExchange for class: Script19    at
  &gt; org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:155)
  &gt;   at javax.script.AbstractScriptEngine.eval(Unknown Source)   at
  &gt; org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:220)
  &gt;   at org.apache.jmeter.timers.JSR223Timer.delay(JSR223Timer.java:42)
  &gt;   at
  &gt; org.apache.jmeter.threads.JMeterThread.delay(JMeterThread.java:806)
  &gt;   at
  &gt; org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:458)
  &gt;   at
  &gt; org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
  &gt;   at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
  &gt;   at java.lang.Thread.run(Unknown Source) Caused by:
  &gt; javax.script.ScriptException: groovy.lang.MissingPropertyException: No
  &gt; such property: messageExchange for class: Script19    at
  &gt; org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:346)
  &gt;   at
  &gt; org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:152)
  &gt;   ... 8 more Caused by: groovy.lang.MissingPropertyException: No such
  &gt; property: messageExchange for class: Script19     at
  &gt; org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
  &gt;   at
  &gt; org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
  &gt;   at
  &gt; org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
  &gt;   at Script19.run(Script19.groovy:5)  at
  &gt; org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:343)
  &gt;   ... 9 more
  </code></pre>
  
  <p>I have already imported necessay jars for groovy support but still have error regarding <code>messageExchange</code>.</p>