Thursday, 15 December 2016

JMeter Integration with Jenkins





This Integration will reduce the risk of performance degradations whenever you add a new feature or fix a bug on your product. if your latest commit inadvertently causes response times to go above an acceptable threshold or SLA, your CI system will automatically raise a ‘red flag’ and mark the build as ‘failed’. This will make it very easy for you to identify the cause (and the responsible person! :) behind the problem.

 Integrate as below:

Step 1:
Download  and Setup Jenkins https://jenkins-ci.org

Step 2:
To get JMeter support on Jenkins, you need to Download the Performance Plugin
Put performance.hpi  file to Jenkins/Plugin folder.

Step 3:
Add the jmeter.save.saveservice.output_format=xml line to the user.properties file (this is located in /bin folder of your JMeter installation

Step 4:
Run Jenkins as java -jar jenkins.war and wait for the “Jenkins is fully up and running" message.


Open the http://localhost:8080 URL

How to Run a JMeter Test in Jenkins

Step 1:
Create JMeter  Test Plan.
Test has to be run in non-GUI mode.

Step 2:
Add new job in Jenkins Add New Item.

Step 3:
 Add Build Step and select execute Windows batch command.

Step 4:
 Put JMeter Non GUI mode command here.



Step 5:
Add Post Build Action and select Publish Performance Test Result Report.
Put result file name with full path in Report Files field. and SAVE

Step 6: 
Click on Build Now  and see the console output.






Wednesday, 14 December 2016

Running JMeter test in Tarus Framework

  • Introduction
  • Installation
  • Running JMeter Test
  • Reporting

Introduction

While running load test in  Non GUI mode (CLI) it is difficut to analyse real time result we can view result only at the end of run by uploading the .jtl file. This limitation can be achive by using Tarus Framework

  • Taurus, an open source test automation tool that extends and abstracts JMeter.
  • Using Taurus we can create easy readable script for JMeter test plan.
  • Platform-independency - runs where Python and Java can run
  • Console stats and pseudo-graphic charts during the test execution
  • Real-time reporting

Installation (For Windows)

Step 1: Install Java.             

Step 2: Install Python.          

Step3Install Taurus Python Dependencies.

Open command prompt. 

Install pip                             pip install --upgrade pip
Install lxml Package            pip install lxml
Install psutil Package        pip install psutil
Install Taurus                       pip install bzt

Running JMeter Test

Save your existing JMeter script in following path
let assume the path of path of python directory under C drive.

C/Python/Scripts

run following command in cmd

cd C/Python/Scripts > bzt example.jmx

where example.jmx is your JMeter Script

Reporting

After runing script using Taurus following Console stats and pseudo-graphic charts will display .


By this we can view result at real time.



Thursday, 15 September 2016

NON GUI MODE

Windows

Step  1: Open commond propmt by typing  CMD in Run prompt.
Step 2 : Go to bin folder of jmeter.
Step 3: type Jmeter  -n -t jmxfile.jmx -l logfile and hit enter.

A summarizer will stsrt  displaying that means load test got started in non gui mode.

To generate HTML file type
Jmeter  -n -t jmxfile.jmx -l logfile  -e -o foldername and hit enter.

 A HTML file will generated after completion of test.

Linux

Step 1: Go to bin folder of jmeter
Step 2 : type .jmeter -n -t jmxfile.jmx -l logfile  -e -o foldername and hit enter.

Log file can be use in GUI mode to track the results any point of time of load test



Distributed Mode

Distributed testing is a kind of testing which use multiple systems to perform stress testing

Nodes of this model

  •  Master: the system running JMeter GUI, control each slave.
  • Slave: the system running jmeter-server, receive command from  the master and send a request to server under test.
  • Target: the web server under test, get request from slaves.

Preconditions

  • The firewalls on the systems are turned off.
  • All the machines should be on same subnet.
  • Use the same version of JMeter.
                                                                   Rodmap


Step 1:

On the slave/Master systems, go to jmeter/bin directory and execute file "jmeter-server.bat


Step 2 :

On the master systems, go to /bin directory and edit file jmeter.properites, add IP slave machine.




Step 3 :

On the master machine, run JMeter GUI and open the test plan.Click Run on the menu bar; select Remote start -> select the IP address of slave machine .












Listeners

Lite Ners

Post-Processors

Post Processor

Pre-Processors

Pre Processors