How to install Jmeter
Prerequisites-To use JMeter on your
machine you should have latest Java Runtime Environment (JRE) installed on your
machine and set the environment variables properly to work.
Installing JAVA:
1.
Download the latest
Jar
file.
2.
To install java in your computer follow given
steps:
·
Install java in your computer.
·
Go to the installed folder, E.g. C:\Program
Files\Java, and check that lib and bin folder’s are present or not.
·
If no then install java again, or if yes then
proceed further.
·
Press “windows+R”, and type sysdm.cpl, then
press enter.
·
After pressing enter:
·
The above window will appear, click advance>Environment
Variable.
·
In system variable variable section, scroll down
to search PATH, and then in Path click on Edit.
·
Now go to the folder where java is installed,
and expand it till bin folder, for E.g..,
·
Now after clicking on edit button for Path, go
to end in text box and after putting semi-column paste the copied path of java
bin in Path variable.
·
Now go to the user variable section and click on New button. Now create a new
variable with the name JAVA_HOME, and in the value paste the of you java. E.g
C:\Program Files\Java. Then save it.
· Again create a new variable with CLASSPATH, and
in the value paste the path of your java library For E.g. C:\Program Files\Java\lib.,
and save it.
·
Now your java is installed successfully.
Installing JMeter
2.
To configure Jmeter in your computer follow the given steps::
·
Extract the downloaded Jmeter folder, and copy
it to the desired drive. For example I put the Jmeter file in C drive.
·
Now press windows+R, and go to system variable
as done while installing java.
·
In user variable, create variable with the name
JMETER_HOME, and in the value paste the path of Jmeter installed folder. For
E.g. C:\Jmeter.
·
Jmeter is configured successfully.
Running JMeter
1) Open JMeter root folder i.e. C:\jmeter
2) Open bin directory inside jmeter folder
3) Double click on “jmeter.bat” file.
4) JMeter will be launched.
The window should be open like this
with a command prompt window-
In this window you will be able
to see the tabs- 1 : Test plan, 2 : WorkBench
As Jmeter is a usefull tool for
load testing,so the first and important this is to record the script.
Script is whatever actions you
have performed in website.
Now to record the script for
testing,first of all right click on workbench and add http proxy server.
After selecting http proxyserver the window will be
like:
Now
we will go to the test plan and right click on it and add thread group like:-
After
selecting thread group:-
[In this window
number of thread users=no of users
Ramp-up period(in
seconds):delay b/w every user
Loop count:how many time you
want to repeat the test]
(Note:-By default the values
will be as in the window)
Now to record the test first of
all open the internet explorer,go to the tools then internet options,go to
connection tab,click on lan settings.check the proxy server and give the
Address:-localhost,port no-8080.click on ok and again click on ok.
Now got to the jmeter window
and select http proxyserver,and click on start.
Open the website in internet
explorer of which you want to test load.I am assuming the website is http://www.google.com/.
And performing some search actions.
Now move back to the jmeter
window and select http proxyserver and click on stop. Then clich on thread
group:-
Below thread
group all are the http requests or we can say it as the recorded script.
Now here is the thing which is
very important is that if you will put the load on web server from your own
computer and the numbers of users are more than 1000 or 500.That time it might
be possible that your computer or jmeter will hang.
To solve this problem we can use Destributed load method in
Jmeter-