The document discusses installing the Groovy engine in Apache Jmeter to enable scripting capabilities. It is a 4 step process: 1) Download the latest Groovy version, 2) Extract and copy Groovy jar files to the Jmeter lib/ext folder, 3) Restart Jmeter, 4) Add a JSR223 sampler where Groovy will be available as a scripting option to write and execute Groovy scripts.
2. Introduction to Bean Scripting Framework (BSF)
• Bean Scripting Framework (BSF) is a set of Java classes which supports following languages within Java
applications and to access Java methods and objects.
• Javascript (using Rhino ECMAScript, from the Mozilla project)
• NetRexx (an extension of the IBM REXX scripting language in Java)
• Commons JEXL
• Python (using Jython)
• Tcl (using Jacl)
• XSLT Stylesheets (as a component of Apache XML project's Xalan and Xerces)
• In addition, the following languages are supported with their own BSF engines:
• Java (using BeanShell, from the BeanShell project)
• Groovy
• Groovy Monkey
• JLog (PROLOG implemented in Java)
• JRuby
• JudoScript
• ObjectScript
• ooRexx (Open Object Rexx), using BSF4ooRexx.
3. Introduction to Bean Scripting Framework (BSF)
• BSF can be downloaded from http://commons.apache.org/proper/commons-
bsf/download_bsf.cgi
• In this presentation, we will see how to install Groovy engine within Jmeter.
5. Installing Groovy in Apache Jmeter – Step 1
• Download latest version of Groovy in http://groovy.codehaus.org/
6. Installing Groovy in Apache Jmeter – Step 2
• Extract the Groovy zip file
• Copy the *.jar files from GROOVY_HOME/lib/
7. Installing Groovy in Apache Jmeter – Step 3
• Paste the Groovy jar files to JMETER_HOME/lib/ext/
• Restart JMeter.
8. Installing Groovy in Apache Jmeter – Step 4
• Add JSR223 Sampler to your test plan
• You could see groovy in the scripting language drop down list box
9. Scripting in Groovy
• Add below snippet to your JSR 223 Sampler
• x = new java.util.Date()
• println x
10. Scripting in Groovy
• When you execute the script, you will get below output in your command prompt.