Groovy script in JMETER

Suhas Deshpande picture Suhas Deshpande · May 23, 2015 · Viewed 10.4k times · Source

I was trying to add groovy (Groovy 2.4.3) to the JMeter 2.13.

I am placing all the %groovy_home%/lib/.jars in %java_home%/lib/ext/groovy-lib/.jar

I added the classpath in jmeter.property file (search_paths=/lib/ext/groovy-lib)

The problem is after starting JMeter, I am able to use Groovy in BSF elements (assertions, Samplers etc) but the JSR223 elements (assertions, samplers etc) are not showing the Groovy script language option.

BSF Showing Groovy

JSR223 Missing Groovy

Any help would be valuable Thanks

Answer

Dmitri T picture Dmitri T · May 24, 2015

The simplest and easiest way to get groovy engine up and running is:

  1. Download the latest version of groovy-all.jar from Maven
  2. Drop it to the /lib folder of your JMeter installation. /lib/ext folder is actually for JMeter core and extensions)
  3. Restart JMeter if it's running (jar pickup process is not dynamic, it is also applicable to any other libraries like Jmeter Plugins, JUnit tests, user.properties file change, etc.)
  4. After restart you should see groovy along with the .jar version in parentheses