soft test ireland - introduction to jakarta jmeter - philip bannon

Download Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon

If you can't read please download the document

Upload: david-odowd

Post on 16-Apr-2017

4.697 views

Category:

Technology


1 download

TRANSCRIPT

Introduction to Jakarta Jmeter

With Philip Bannon

Mail: [email protected]

Presentation Objectives

Give you an introduction into:Functional testing with Jmeter

Performance testing with Jmeter

Non-Functional testing with Jmeter

Help you figure out if Jmeter is suited for testing your applications

Brief Introduction to Jmeter

So what is Jmeter:Jmeter is an automated testing tool from the Jakarta project (active)

It's 100% Open Source

Written in Java so its completly portable

Can be used for Unit Test Tool for JDBC, FTP, LDAP, Web Services, JMS, HTTP and TCP connections (plus more)

What can You do with it??

Most test related activities:Perform automated Functional Tests

Perform Performance tests (Load, Stress, Soak)

Carry out Non-Functional Tests

Unit Testing

Benifits of Using Jmeter

Excellent cost saving solution for small projects as it is an open source tool

Robust in handling complex test scenarios that demand n number of virtual users.

Complete portability and supports 100% all the Java based applications.

Less scripting efforts as compared to other tools because of its user effective GUI.

Really Designed to conduct Load, Stress, Volume & Endurance tests on the Web & Webservice based applications

HTTP & HTTPS load testing can be done without any adding additional pluggable samplers

How Jmeter works

StartCreates requests to target server and simulates a number of usersEnd

Jmeter gathersData to calculate Statistical info

Server RespondsJmeter SavesAll Responses Report

Jmeter simulates a group of users sending requests to a target server, and return statisticts that show the perfomance / funcationality of the target server / application via tables, graphs etc.

Build Blocks

Test Plan

Thread Group

Controllers & Config elemets

Samplers

Listeners

Timers

Assertions

Pre-Processor Elements

Post Processor Elements

Thread Group

Thread Group elements are the beginning points of your test plan. All samplers and controllers are children of a thread group node.

As the name suggests, the thread group elements controls the number of threads Jmeter will use during the test.

We can also control the following via the thread Group:Set the number of Threads

Set the Ramp Up Time

Set the number of test itterations

Controllers & Config Elements

Logic Controllers:Logic Controllers let you control the flow of your test for example you can have IF conditions for selecting certain samplers.

Configuration Elements:Config elements can be used to set up defaults and variables for later use by samplers.HTTP Manager

HTTP Request Defaults

Cache Managers

Cookie Manager

Logic Controllers

Logic Controllers let you control the flow of your test.

Logic Controllers can change the order of request coming from any of their child elements

Some Examples:ForEach Controller

While Controller

Loop Controller

IF Controller

Run Time Controller

Interleave Controller

Throughput Controller

Run Once Controller

Samplers

Samplers tell Jmeter to send requests to a server. For example, you can add a HTTP Request sampler if you need to perform a POST, GET, DELETE on a HTTP service

Some usefull samplers:HTTP Request

FTP Request

JDBC Request

Java Request

SOAP/XML Request

RPC Requests

Listeners

Listeners provide access to the information that Jmeter gathers about the tests which are executing. For instance Response codes, messages etc. Some Listeners are:View Results Tree: This shows the details of the sampler requests and the responses and can display them in different formats

Summary Report:This shows a summary in tabular form of the results from executing samplers

Graph Results:This will show us the response times and response codes on a graph

Listeners can write their information out to files in XML or CSV format

Timers

By default, a Jmeter thread will send send requests without pausing between each sampler. This may not be what you want....

We can add a timer element which will allow us to define a period to wait between each request.

Timers can act as a throttle!

Note the scope of the Timer!

Assertions

A test isn't a test unles it checks something!

Assertions are what do the checking

Assertions allow you to assert facts about the responses received from the application under test. Using assertions you can prove that your application is returning the correct data.

Jmeter will highlight when an assertion fails

Pre-Processor &
Post Processor

A Pre-Procesor is something that will happen before a sampler executes.

A Post Processor executes after a sampler finishes its execution.

The are usufull processing the response which is recieved from the application

For exmple:Perfoming Xpath Extractions

Regular Expression Extractions

Lets do a functional Test

DEMO!!

Record and playback

Jmeter can act as a proxy server between your browser and the web recording your actions.

This can help in writing your web tests.....

Lets do another small demo?

Performance Testing

Good Performance testing

What is performance testing

Performance Testing sets the best possible performance expectation under a given configuration of infrastructure. It also highlights early in the testing process if changes need to be made before application goes into production

Aims of Performance Tests

What level of load can your Application handle

How fast your system will perform

Find bottlenecks

Determine how much hardware you'll need for Production (scalability)

How reliable is your software

Some definitions

Load TestingLoad testing identifies the maximum operating capacity of your app as well as any bottlenecks

Stress TestingStress testing is focused on finding out the robustness and availability of your app under heavy loads (When will your system fail?)

Soak TestLike load but over a long duration

Scalabitilty testing This will determine whether adding extra hardware will increase your apps response time

Performance Testing

The Usual ProblemWrite Code

Execute Unit Tests

Pass it to QA

Just before Production do some Performance testing....and Panic!!

A Better Way

Performance test artifacts as soon as they pass Unit and Functional Testing

Fast feedback for Dev's

No Suprises

Get the software out the door on time!!!

What do you need for Performance Testing

System Under Test i.e. Your application!

Benchmark & Profile

Realistic Hardware of what is or will be in production

Load Generating machines (Jmeter)

Monitoring tools

Data Repository

Prepare your environment (Network, storage etc)

Isolation!

Traffic Model, Traffic Model, Traffic Model!

Without a Traffic Model you just putting load on your server for the sake of it!

Based on projections you should be able to work out what your users will be doing and how often!

This can all be reflected in your test!

Demo

Lets write a basic script in Jmeter to test performance of a HTTP web app

Non-Functional Testing with
Jmeter

Demo

Automated Testing

Jmeter integrates seemlessly with CL toolsANT

HTML Report Generation

Q&A

Questions and hopefully answers

Muokkaa otsikon tekstimuotoa napsauttamalla

Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso