Tuesday, April 28, 2009

Running JMeter on HTTP


1. Download latest JMeter to GMOnline Computer
Goto http://jakarta.apache.org/site/downloads/index.html
Click “JMeter”
Select the zip file under “Binary” (Current version is 2.3.2.zip)
2. Unzip the downloaded zip file
3. Go to “jakata-jmeter-2.3.2/bin” folder and click “jmeter.bat”. If an error is displayed, you may not have JRE installed, go to step 4; otherwise go to step 5.
4. Install JRE
Go to http://java.com/en/download/index.jsp
Click “Free Java Download” button
Follow the instruction to download and install latest JRE
5. After “jmeter.bat” is clicked, the application is displayed


6. Right-click the Test Plan element and select Add and then Thread Group. JMeter will create a thread group element under Test Plan element.
7. In this page, you can set the following properties:
Name -- the name of this thread group. You can give a descriptive name to this property such as “ERMS Applet Test”.
Number of Threads -- the number of threads created. Each thread represents a single user. Therefore, if you want to simulate a load test with 10 concurrent users, enter 10 as the value for this property.
Ramp-Up Period -- the number of seconds JMeter will take to accelerate to create all of the threads needed. If the number of threads used is 10 and the ramp-up period is 20 seconds, JMeter will take 20 seconds to create those 10 threads, creating one new thread every two seconds. If you want all threads to be created at once, put 0 in this box.
Forever -- if clicked, this option tells JMeter to keep sending requests to the tested application indefinitely. If disabled, JMeter will repeat the test for the number of times entered in the Loop Count box.
Loop Count --this property value only has an effect if the Forever check box is unchecked. It tells JMeter the number of times it has to repeat the test.
8. Right-click the Thread Group element, and select Add, Sampler, and then HTTP Request. An HTTP Request element will be added to the Thread Group element. Click the HTTP Request element to select it.
9. On the HTTP Request screen, you configure the HTTP requests that will be used to "hit" your application. Here, you can set the following properties.
Name -- the name of this HTTP request. The name should be descriptive such as “Request ERMS Applet”; it is common to have multiple HTTP Request elements in a thread group.
Server Name or IP -- the server name or the IP address of the machine running the application being tested. (“erms.nam.gm.com”)
Port Number -- the port number used by the application. Normally, a Web application runs on port 80.
Protocol -- the protocol used, either HTTP or HTTPS. (ERMS uses HTTP)
Method -- the request method, either GET or POST.
Path -- the path to the resource that will handle this request. (e.g. “/aptest”)
Follow Redirects -- follows redirections sent by the Web application, if any.
Use KeepAlive -- if checked, sends the Connection = Keep-Alive request header. By default, an HTTP 1.1 browser uses Keep-Alive as the value of the Connection header. Therefore, this checkbox should be checked.
Parameters -- the list of parameters sent with this request. Use the Add and Delete buttons to add and remove parameters. (none)
Send a file with a request -- simulate a file upload to the Web application. (none)
Retrieve All Embedded Resources from HTML Files -- download embedded content including Applet. Make sure this option is checked
10. The last element that we need to add to our test plan is a listener, which in JMeter is the same as a report. JMeter comes with various reports to choose from. A report can be a table or a graph. For this testing, use the easiest report available: a table.
11. To add a listener, right-click the Thread Group element, select Add, and then Listener and View Results in Table. Now you are ready to run the test plan.
12. Before you run your test plan, however, you are advised to save the test plan just in case JMeter crashes the system (an occasional occurrence with higher numbers of threads and loop counts).
13. Select Start from the Run menu to execute the test plan.
14. Click on ”View Results in Table” to view the result.

No comments:

Post a Comment