11
Installing Groovy engine in Apache Jmeter NAVEENKUMAR NAMACHIVAYAM Founder – QAInsights.com http://QAInsights.com

Installing Groovy engine in Apache Jmeter

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Installing Groovy engine in Apache Jmeter

Installing Groovy engine in Apache Jmeter

NAVEENKUMAR NAMACHIVAYAMFounder – QAInsights.com

http://QAInsights.com

Page 2: Installing Groovy engine in Apache Jmeter

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.

Page 3: Installing Groovy engine in Apache Jmeter

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.

Page 4: Installing Groovy engine in Apache Jmeter

Installing Groovy Engine in Apache JMeter

Page 5: Installing Groovy engine in Apache Jmeter

Installing Groovy in Apache Jmeter – Step 1

• Download latest version of Groovy in http://groovy.codehaus.org/

Page 6: Installing Groovy engine in Apache Jmeter

Installing Groovy in Apache Jmeter – Step 2

• Extract the Groovy zip file

• Copy the *.jar files from GROOVY_HOME/lib/

Page 7: Installing Groovy engine in Apache Jmeter

Installing Groovy in Apache Jmeter – Step 3

• Paste the Groovy jar files to  JMETER_HOME/lib/ext/

• Restart JMeter.

Page 8: Installing Groovy engine in Apache Jmeter

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

Page 9: Installing Groovy engine in Apache Jmeter

Scripting in Groovy

• Add below snippet to your JSR 223 Sampler

• x = new java.util.Date()

• println x

Page 10: Installing Groovy engine in Apache Jmeter

Scripting in Groovy

• When you execute the script, you will get below output in your command prompt.

Page 11: Installing Groovy engine in Apache Jmeter

Thank you

Please visit http://qainsights.com/services for more training programs.