Category: "Web, development" , Tags: HTTP, JMeter, pattern, request, sampler, test
A few days before, I used JMeter for the other project.
Shacho told me “The one we are working on now, I’d like to use the tool called JMeter for load test, so can you check the usage?”. But I haven’t even heard about the name of the tool and felt like “????”, started research on the WEB with complete confusion.
Anyway, the best way to learn is to use it by myself. I downloaded it and tried.
The way we used the tool this time was rather pattern test than load test.
I think I can say that the advantages were as below.
- Can test the validity of the request
- Don’t have to set test value repeatedly
- Easy to copy test content
- Can also set dynamic value (increment, this time)
And things difficult to handle.
- When viewing test result in tree, it only shows sampler name, therefore, difficult to distinguish patterns
- With the provided Listener, it takes quite some time to document the test result
(well, it’s matter of course)
【JMeter】
(Download:http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi)
When using on Windows, startup from bin\jmeter.bat in the decompressed directory.
The first thing I thought while looking through some of the websites that explain the usage is that wording in JMeter and the things I want to do won’t connect easily.
As “What’s sampler?”
So, I think I should note what I did as a memorandum.
- The first thing to do is to create a “Thread group”
Startup, and there are only ‘Test Plan’ and ‘Benchmark’. Right-click the ‘Test Plan’ element.
Create “Thread Group”.
This is the basic settings for the test to execute. For example for load test, throw how much request in what interval?
If you want throw same number of request in every test pattern then you don’t have to care much about this, but if you want it to vary, set here.
Also it is effective to divide it into the units that you want to see the results on.
- Next “Sampler”
Sampler is a very root of the request to throw.
Set information of the server to throw the request, and the method and the file to call up.
Also you can set parameters here.
I mean like http://[server information]/[file to call up]/[parameters], each item of the settings on the screen would be connected and make up a request.
At first, this was something difficult to grasp.
- Wants to put extension headers
If you want to add an unique header as an extension header, add “HTTP Header Manager” in configuration element.
Now you can set a header field and the value.
- Set what you want to be on every HTTP request
Add “HTTP Request Defaults” to the hierarchy above the one you want to reflect this.
And all samplers under that will reflect the settings.
It is effective when you want to change part of the request as you don’t have to input same things again and again.
That’s all for now.
Next time is about Listener.


