How To Setup Jmeter

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

HOW TO SETUP JMETER

Prerequisites:

1. AWS Account
2. Create Two Virtual Machines as Master and Slave
3. Create both the VM in same subnet.
4. JMeter installation file.
5. Java 1.8

1. Installing JMeter and Java:

1.1 One VM created in AWS, open the Master VM and install Java and JMeter.
1.2 JMeter can be downloaded from https://jmeter.apache.org/download_jmeter.cgi and
look for below binaries and download zip folder.

1.3 Java can be downloaded and installed from


https://www.java.com/download/ie_manual.jsp.
1.4 Once installed Java, set the java home path in the environment variable using the link
https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-
8895.html.
1.5 Once the Jmeter downloaded, just unzip and place it on your own convenient disk.
I placed it on download folder and here the path of Jmeter,
1.6 Copy the folder path up to bin and set environment variable as “JMETER_HOME” and
the value will be “C:/Downloads/apache-jmeter-5.4.1/apache-jmeter-5.4.1/bin”. Kindly
use the link to set env variable https://confluence.atlassian.com/doc/setting-the-
java_home-variable-in-windows-8895.html.
1.7 Ensure you have installed Java and JMETER GUI works fine first.
1.8 To ensure type open cmd prompt and enter java –version and it will show the version of
java.
1.9 To ensure the Jmeter , open cmd prompt and type jmeter, it will open the jmeter GUI.
This will work one and only if you added the env variable properly.
1.10 Once Jmeter Opened, close as of now.
1.11 These above steps should be done on both master and slave systems.

2. Configuring Master VM:

2.1. Running the Jmeter:

2.1.1 First, we need to start the Jmeter Server, to do so go to jmeter placed folder upto
bin location and open the location in the cmd prompt. Refer image below.

2.1.2 Place the mouse pointer on the bar and type cmd then enter, it wil open you the
cmd prompt.
2.1.3 On the command Prompt type “jmeter-server” and enter, it will show something
like below. The server has been started.

2.1.4 Now, to run jmeter gui, again go to the jmeter bin location and open in command prompt
and type “jmeter” , it will open a GUI and it will show something like below.
2.1.5 Now all the services are running, Do the same on the slave system also.

2.2 Configure Jmeter Properties:

2.2.1 Go to jemeter bin location and look for jmeter.properties file.

2.2.2 Edit the file and modify the below values.


2.2.3 Remote host: Add the private IP of Slave system. No need to use port.

Server rmi property: By default it is false, change as true and uncomment it.
Open user.propeties file from the same bin location and add these below two
properties.

3. Slave Configuration:

3.1 Do the entire configuration as we done in the master system.

In jmeter.properties file, in remote host add the private IP of Master System.

4. Firewall Configuration:

4.1 Turn off the Domain, Private and Public Profile Firewall in both the Master and Slave.

Type “Firewall” and look for “Windows defender Firewall with Advanced Security” and click on
that.

At first the screen will look like below.


4.2 Click on “Windows Defender Firewall Properties”, it will open the below window.

4.3 Click on Domain Profile and Turn Off and Apply, follow these for the Private and Public
Profile as well.

Final window will be look like below given.


5. Add Firewall Rule in AWS:

Login to AWS and Click on Services > Go to EC2 > Instances Running

Check the Security Group name and Click on the Security Groups that is found under the left
side of Network & Security.

Click on the SecurityGroup ID and it will open the below screen, edit and add the rules provided
below.
1. Create jmx file by recording session using blazemeter.
2. Need to segregate the task by creating label for each click like login, click assessment,
click checkbox, Start Assessment, Finish Assessment, logout.
3. Then need to login to download jmx
4. Need to exclude unwanted like css, js and logo related to ease the load.
5. Instead need to add “Retrieve all Embedded Resources” in Advanced Setting for each
included HTTP Request.
6. Login and get the token
7. To add variable Add> Post Processor> add regular expression extractor
8. Then replace auth value with create c_token variable, likewise replace email and userid.
i.e., replace single value in to dynamic value for userid , email and roleid.
9. Need to change username, email, roleid in body data also as a dynamic expression.
10. Clear cache and cookie every time we run the test.
11. Check Retrieve all embedded resources.
12. Signar connect – gets error
13. Dashboard.htm, signin page, login html redirects many resources.
14. Method not available getskillloggerenableornot
15. Change attempt no into dynamic values

No of thread = no of users = 100


Ramp of sec : 10 sec… per sec 10 user to load

1000 sec = every 10sec 1 user will load

Infinite :

Specific thread lifetime should be checked and provide duration like 300mins.

No need to change anything in slave file jmeter.properties.

We can add both master and slave IP in the master system jmeter.properties.

Kept 5 sec delay between each task as uniform random timer.

You might also like