Successfully reported this slideshow.

Installing Groovy engine in Apache Jmeter

11,050 views

Published on

This presentation explains how to install Groovy engine in Apache JMeter and start scripting in Groovy using JSR 223 Sampler.

Published in: Technology
  • Hi Naveen, Thanks for the presentation. 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 t 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 Any help would be valuable Thanks
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Installing Groovy engine in Apache Jmeter

  1. 1. Installing Groovy engine in Apache Jmeter NAVEENKUMAR NAMACHIVAYAM Founder – QAInsights.com http://QAInsights.com
  2. 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. 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.
  4. 4. Installing Groovy Engine in Apache JMeter
  5. 5. Installing Groovy in Apache Jmeter – Step 1 • Download latest version of Groovy in http://groovy.codehaus.org/
  6. 6. Installing Groovy in Apache Jmeter – Step 2 • Extract the Groovy zip file • Copy the *.jar files from GROOVY_HOME/lib/
  7. 7. Installing Groovy in Apache Jmeter – Step 3 • Paste the Groovy jar files to JMETER_HOME/lib/ext/ • Restart JMeter.
  8. 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. 9. Scripting in Groovy • Add below snippet to your JSR 223 Sampler • x = new java.util.Date() • println x
  10. 10. Scripting in Groovy • When you execute the script, you will get below output in your command prompt.
  11. 11. Thank you Please visit http://qainsights.com/services for more training programs.

×