<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=JMeter_Advanced</id>
	<title>JMeter Advanced - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=JMeter_Advanced"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=JMeter_Advanced&amp;action=history"/>
	<updated>2026-05-13T09:38:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=JMeter_Advanced&amp;diff=23920&amp;oldid=prev</id>
		<title>Cesar Chew at 16:49, 24 November 2014</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=JMeter_Advanced&amp;diff=23920&amp;oldid=prev"/>
		<updated>2014-11-24T16:49:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cat|JMeter|50}}&lt;br /&gt;
== Transaction Controller ==&lt;br /&gt;
* Allows to aggregate results for many samplers&lt;br /&gt;
* Useful for Ajax&lt;br /&gt;
* Can be used as an alternative for downloading embedded elements&lt;br /&gt;
Sachin garg 9871702532&lt;br /&gt;
&lt;br /&gt;
== Connecting to a Database ==&lt;br /&gt;
* Added MySQL JDBC driver: http://dev.mysql.com/downloads/connector/j/5.1.html&lt;br /&gt;
* Copy the appropriate .jar file to the “lib” directory of your JMeter installation&lt;br /&gt;
&lt;br /&gt;
=== Setting up a connection ===&lt;br /&gt;
[[File:JMeter MySQL Connection Configuration.png]]&lt;br /&gt;
&lt;br /&gt;
== Extracting data from SQL result ==&lt;br /&gt;
* This example takes tab separated data returned by a database call and adds it to db_rows&lt;br /&gt;
* Note the -1, which when combined with a ForEach Logic Controller processes all rows&lt;br /&gt;
[[File:JMeter Extracting Data From SQL Query.png]]&lt;br /&gt;
&lt;br /&gt;
== Extracting Multiple Values ==&lt;br /&gt;
Pattern&lt;br /&gt;
 name=&amp;quot;file.name&amp;quot; value=&amp;quot;readme.txt&amp;quot;&lt;br /&gt;
Reference Name:&lt;br /&gt;
 MYREF&lt;br /&gt;
Regex:&lt;br /&gt;
 name=&amp;quot;(.+?)&amp;quot; value=&amp;quot;(.+?)&amp;quot;&lt;br /&gt;
Template:&lt;br /&gt;
 $1$$2$&lt;br /&gt;
The following variables would be set:&lt;br /&gt;
 MYREF: file.namereadme.txt&lt;br /&gt;
 MYREF_g0: name=&amp;quot;file.name&amp;quot; value=&amp;quot;readme.txt&amp;quot;&lt;br /&gt;
 MYREF_g1: file.name&lt;br /&gt;
 MYREF_g2: readme.txt&lt;br /&gt;
 ${MYREF}, ${MYREF_g1} etc&lt;br /&gt;
&lt;br /&gt;
== Using Beanshell ==&lt;br /&gt;
* BeanShell interpreter: http://www.beanshell.org/download.html&lt;br /&gt;
* BeanShell is one of scripting languages available within JMeter &lt;br /&gt;
* With BeanShell you can create custom outputs, perform logical operations, manipulate variables, etc.&lt;br /&gt;
&lt;br /&gt;
== Simple BeanShell Example ==&lt;br /&gt;
* In this BeanShell example having gathered the last known user ID from a user table with a JDBC Request and putting it in a variable with a Regex Extractor, this is used to calculate what the next two user ID&amp;#039;s will be with BeanShell:&lt;br /&gt;
[[ File:JMeter - BeanShell Script.png]]&lt;br /&gt;
* Note ${lastid} is passed in using the Parameters box, but this is not necessary – you can also use vars.get(“lastid”) from within the script itself&lt;br /&gt;
* Anything passed in to a BeanShell Sampler using the Parameters field is held in the Parameters variable&lt;br /&gt;
&lt;br /&gt;
== BeanShell Inline ==&lt;br /&gt;
* You can run snippets of BeanShell wherever by taking advantage of JMeter BeanShell function. The syntax is:&lt;br /&gt;
 ${__BeanShell(code here as escaped string)}&lt;br /&gt;
* E.g. setting a variable:&lt;br /&gt;
 ${__BeanShell(vars.put(“name”\,”value”))}&lt;br /&gt;
* Note the “slash” before the comma – special characters must be escaped within the __BeanShell function&lt;br /&gt;
&lt;br /&gt;
== BeanShell Inclusion ==&lt;br /&gt;
* You may also call external BeanShell scripts, like this example from the JMeter manual:&lt;br /&gt;
 ${__BeanShell(source(&amp;quot;function.bsh&amp;quot;))} &lt;br /&gt;
* The above line invokes the BeanShell script in the file “function.bsh”&lt;br /&gt;
* The __BeanShell function (like all JMeter functions) can be invoked anywhere you can normally use a variable&lt;br /&gt;
&lt;br /&gt;
== ForEach Logical Controller ==&lt;br /&gt;
* Amongst its many uses, this can be used, in conjunction with a JDBC Request, to cycle through all the rows returned from a database select query:&lt;br /&gt;
[[File:JMeter ForEach Controler.png]]&lt;br /&gt;
* The input variable must match the reference name in your Regex Extractor for the sampler&lt;br /&gt;
* Output variable is the data for the specific row&lt;br /&gt;
&lt;br /&gt;
== Manipulating data with BeanShell ==&lt;br /&gt;
* Within a ForEach controller, use a BeanShell Sampler to load, format and output each row of the database result&lt;br /&gt;
* Don&amp;#039;t forget your BeanShell Sampler must be nested under the ForEach controller to be affected by it – otherwise it will only execute once on the final value&lt;br /&gt;
&lt;br /&gt;
== JMeter Calculating Frequencies ==&lt;br /&gt;
 // noOfThreads1 = Integer.parseInt(Parameters);&lt;br /&gt;
 noOfThreads1 = Integer.parseInt(vars.get(&amp;quot;NT_ANON&amp;quot;)); &lt;br /&gt;
 noOfThreads1 = noOfThreads1 * 2;&lt;br /&gt;
 vars.put(&amp;quot;NT_ANON&amp;quot;,noOfThreads1.toString());&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
* ${__time(yyyyMMdd-HHmmss ,TIME)}&lt;br /&gt;
&lt;br /&gt;
== Extras ==&lt;br /&gt;
* Markov4JMeter&lt;br /&gt;
* Plugins (Sampler)&lt;br /&gt;
** http://rubenlaguna.com/wp/better-jmeter-graphs/&lt;br /&gt;
** http://code.google.com/p/jmeter-plugins/wiki/RespTimesDistribution&lt;/div&gt;</summary>
		<author><name>Cesar Chew</name></author>
	</entry>
</feed>