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.