• Home
  • Testing
  • SAP
  • Web
  • Must Learn!
  • Big Data
  • Live Projects
  • Blog

 

As soon as you launch JMeter , you will see 2 elements

  1. Test Plan
  2. Workbench

 Hands on with JMeter GUI

 

Test Plan

Test Plan is where you add elements required for your JMeter Test.

It stores all the elements (like ThreadGroup, Timers etc) and their corresponding settings required to run your desired Tests.

Following figure shows an example of Test Plan

Hands on with JMeter GUI

WorkBench

The WorkBench simply provides a place to store test elements temporarily. WorkBench has no relation with Test Plan. JMeter will not save the contents of the WorkBench. It only saves the contents of the Test Plan branch

Hands on with JMeter GUI

 "WorkBench" will be used in our tutorial HTTP Proxy Server Recording Test

For now , ignore it.

Adding Elements

Adding Elements is the essential step to build a Test Plan because without adding elements, JMeter cannot execute your Test Plan

A Test Plan includes many Elements such as Listener, Controller, and Timer 

You can add an element to test plan by right-clicking on a Test Plan, and choose new elements from "Add" list.

Suppose, you want to add 2 elements to Test Plan BeanShell Assertion and Java Request Default

  •  Right click Test Plan -> Add -> Assertion-> Bean Shell Assertion
  •  Right click Test Plan -> Add -> Config Element -> Java Request Default

Hands on with JMeter GUI

You can also remove unused element

Let's say, you want to remove element "HTTP Request Defaults", select "HTTP Request Default" -> Right click-> choose Remove from the context menu -> Click Yes to confirm delete this element on message box

Loading and Saving Elements

Saving Elements

Suppose you have already added an element name "BeanShell Assertion".  Now you want to save it.

Right click BeanShell Assertion -> select Save Selection As

Hands on with JMeter GUI

A dialog box display, click Save button to save your elements under default name BeanShell Assertion.jmx. You can choose other name if you want

Hands on with JMeter GUI

JMeter Test Elements and Test plan are stored in *.JMX format. JMX is standing for Java Management Extensions.

Loading Elements

Loading exist element helps you save your time required to create & configure new elements

Let's say,  that you have an existing element in Test Plan: Java Request Default

Right click Java Request Defaults-> select Merge

Hands on with JMeter GUI

Choose the Elements (BeanShell Assertion.jmx.) file in the directory. This element will be added to your current test plan.

Hands on with JMeter GUI

Configuring Elements

In order to configure any Element

  1. Select the element in the Tree on Left Pane
  2. Enter configuration settings on the Right Pane

Hands on with JMeter GUI

Running and Stopping a Test Plan

Before running a test, you should save your Test Plan first. Saving your Test Plan helps you avoid unexpected error when running the test plan. Steps to save Test plan -

  1. File -> Save Test Plan as-> a Dialog box display
  2. Enter a filename of Test Plan ->click Save

Hands on with JMeter GUI

Note: Saving a Test Plan is different from saving elements.

Saving a Test Plan

Saving an Element

Test Plan consists of one or many elements

Element is a basic component of JMeter

When you save your Test Plan, all those elements in the plan are saved

When you save your elements, only one element is saved.

Create Combo Test Plan

You can merge one or many Test Plans to create a combo Test Plan as shown in below figure

Hands on with JMeter GUI

Suppose you already have an existing Test Plan name Test_Fragment.jmx on your computer (This article includes this file).You can merge this test plan to current Test Plan on JMeter to create a new Test Plan.

Hands on with JMeter GUI

Now all the test elements in file Test_Fragment.jmx are added to your current test plan as shown in the figure below

Hands on with JMeter GUI

Run Test Plan

To run your single or multiple test plans, choose Start (Control + R) from the Run menu item.

Hands on with JMeter GUI

When JMeter is running, it shows a small green box at the right hand end of the menu bar.

Hands on with JMeter GUI

The numbers to the left of the green box are the number of active threads / total number of threads.

To Stop the Test, press Stop button or use short key Ctrl + '.'

Hands on with JMeter GUI

Test Report

When test execution is done, you can get the test report. The test report includes the error log file, which is saved in jmeter.log, and the test result summary. Here is a sample log file of JMeter

  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: Copyright (c) 1998-2013 The Apache Software Foundation
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: Version 2.9 r1437961
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: java.version=1.7.0_25
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: os.name=Windows 7
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: os.arch=x86
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: os.version=6.1
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: file.encoding=Cp1252
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: Default Locale=English (United States)
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: JMeterHome=C:\Nguyen\Source_code\apache-jmeter-2.9
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: user.dir  =c:\Nguyen\Source_code\apache-jmeter-2.9\bin
  • 2013/08/18 08:41:12 INFO  - jmeter.JMeter: PWD       =C:\Nguyen\Source_code\apache-jmeter-2.9\bin

 

YOU MIGHT LIKE: