Apache JMeter

From XennisWiki
Jump to: navigation, search

Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications. (Wikipedia)

Installation

Arch Linux

Install the jmeter package.

Download

Download and unpack JMeter.

Plugin manager

Install the plugin manager

Download the JAR of the JMeter Plugins Manager and copy in into the lib/ext directory of JMeter. Then start JMeter and go to Options > Plugins Manager.

Install plugin without GUI

Further information: Plugins Manager from Command-Line

Install the plugin manager

cd /lib/etx
wget https://jmeter-plugins.org/get/ -O jmeter-plugins-manager-0.11.jar

Setup the requirements for the plugin manager

wget http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.0/cmdrunner-2.0.jar -O lib/cmdrunner-2.0.jar
java -cp lib/ext/jmeter-plugins-manager-0.11.jar org.jmeterplugins.repository.PluginManagerCMDInstaller

Install for instance the WebDriver plugin

bin/PluginsManagerCMD.sh install jpgc-webdriver

Plugins

Selenium/WebDriver Support

Further information: Web Driver Sampler

Logging

WDS.log.info(WDS.name + ' run');

Parameters

// Parameters input http://example.org 10
var host = WDS.args[0]
var count = WDS.args[1]

Simple request with a button click

WDS.sampleResult.sampleStart()
WDS.browser.get('http://example.org')

var pkg = JavaImporter(org.openqa.selenium)
var submitButton = WDS.browser.findElement(pkg.By.id('exampleSubmitButton'))
submitButton.click()

WDS.sampleResult.successful = true
WDS.sampleResult.sampleEnd()

External links