Summary about Jmeter and performance testing
How to create Jmeter scripts?
Recording Jmeter scripts using Jmeter’s HTTP(S) Test Script recorder. There are two ways
1) Manually adding scripts ( Test plan >> Tread Group >> Add>> Sampler >> HTTP Request )
2) Recording using Jmeter’s HTTP(S) Test Script recorder
How to record Jmeter scripts using HTTP(S) Test Script recorder
Prior doing that we need to configure browser and learn about the Proxy setup
Jmeter to Application server communication need to be routed thru a browser Proxy for this recording purpose. For that you may need to select the Browser (here we can use Firefox browser”
1) Navigate to Firefox >> Tools >> options >> Advanced >> Network >> Settings
2) Select Manual Proxy configuration >> HTTP Proxy = localhost & Port = 8080
How to run Jmeter in Jenkins
Jenkins setup and performance plugin setup:
1) copy performance plugin into Jenkin’s home directry before you start the test.
2) to do that – you can download the performance plugin “performance.hpi” from the site https://wiki.jenkins-ci.org/
3) how to find the home directry of jenkins – to do that you can navigate to jenkins home page (localhost:8080) and then
4) click on “Manage Jenkins” and then click on “Configure system” the you will notice “Home directy” path in there.
Configure Jmeter and create a basic script in Jmeter:
5) download Jmeter Binary zip file from Jmeter site http://jmeter.apache.org/
6) unzip it and go to the “bin” directory of the Jmeter folder, wherre you will notice “user.properties” file.
7) open the file in notepad or notepad++ or any other text editor
8) add a line “jmeter.save.saveservice.
9) create a Jmeter script and make sure you can run it in non GUI mode i.e either in DOS mode or using shell scripts in MAC (note down the commands used in respective OS and it could be used in Jenkins job setup)
Note: for windows command line run, you can use the following commands
C:\[JMETER BIN directory]\jmeter.bat -Jjmeter.save.saveservice.
setup Jenkin’s job to run Jmeter scripts
9) go to Jenkins home page (localhost:8080) and then click on “New Item” on “Freestyle project”
10) in the “New item” page, give some name in the item name field and go to below to section “Build” and add build step
11) add build step can be either a) “execute windows batch command” for windows or b) “Execute shell” for MAC
12) provide your command in there and save.
13) Click on “Build now” which would call the Jmeter (jmx) file and run the program
14) after the run, you can verify the Jenkins console to review the results.