Jmeter
Installation
1 Install JRE
Download the JRE from http://www.oracle.com website.
Jmeter require at least JRE 1.6
2 Set Environment Variables (Windows)
Go to Control Panel / System / Advanced System Setting / Environment Variables
A. Create System variable
Variable: JAVA_HOME / Value: <JRE PATH>
Example: C:\Program Files (x86)\Java\jre8
B. Modify System variable
Variable: PATH
Add following value:
;%JAVA_HOME%\bin; %JAVA_HOME%\jre\bin
3 Download Jmeter
Download the binary and zip version
4 Install Jmeter
Unzip the download zip file.
Go to path <install path>/bin
Double click Jmeter.bat
After a while, the following windows will pop out.

Configuration
1. Following steps show how to setup on test case:
A. Send request to Tomcat API in Test Environment
B. The test will keep going until user stop it.
2. Create “Thread Group”
Right click Test Plan, click Add / Threads (Users) / Thread Group

Change the value of parameter:
A. Number of Threads (users): 5
B. Ramp-Up Period (in seconds): 10
C. Loop Count: choose “Forever”
D. Choose “Delay Thread creation until needed”

3. Create “HTTP Request”
Right click Thread Group, click Add / Sampler / HTTP Request

Change the value of parameter:
A. Web Server / Server Name or IP: tr4ns1.tr4ns.com
B. HTTP Request / Implementation: HttpClient4
C. Protocol [http]: http
D. Method: POST
E. Path: /mCardServer2.20/mCardService
F. Remove the choice of: Follow Redirects / Use KeepAlive
G. Body Data: input the test case
Example:
{
"programID":"9",
"traderID":"8604853",
"password":"xxxx",
"requestType":"GetTraderIdents"
}

4. Create “Constant Throughput Timer”
Right click Thread Group, click Add / Timer / Constant Throughput Timer

Change value of parameter:
Delay before each affected sampler / Target throughput (in samples per minute): 30

5. Create “Save Responses to a file”
Right click Thread Group, click Add / Listener / Save Responses to a file

Change value of parameter:
Filename prefix: mcard/http_requests
The file of the response will be saved in
<Jmeter install folder>/bin/mcard/http_requests<number>.json

6. Start Test
Click the “Start” button or Menu “Run / Start” to start the test.

7. Stop Test
Click the stop button or Menu “Run / Stop” to stop the test.

Comments
Post a Comment