Step 1: Start JMeter by running the JMeter.bat file for Windows or the JMeter file on Unix.
Name -- You can give any name to the thread group. Number of Threads -- You can enter as many threads to stimulate a load test. A single user is represented by each Thread so if you wish to simulate a load test with 5 concurrent users then you need to enter 5 as the value for this property.
Ramp-Up Period -- It indicates the time taken by Jmeter to create all of the threads needed. If you set 10 seconds as the ramp-up period for 5 threads then the JMeter will take 10 seconds to create those 5 threads. Also by setting its value to 0 all the threads can be created at once.
Forever -- If you choose this option then the Jmeter will keep sending the unspecific requests to the tested application. And if disabled then the test will be repeated the number of times entered in the Loop Count box.
Loop Count -- By specifying its value Jmeter gets to know that how many times a test is to be repeated provided that the Forever check box should be unchecked.
Step 3: Now you need to mention the HTTP request (URL and parameters). To this right click on the Thread Group node then you need to select Add -> Sampler -> HTTP Request as shown in the picture.
Name -- You should put a descriptive name as a thread group can have multiple HTTP Request elements. Server Name or IP -- Mention the server name or the IP address of the machine which is running the application to be tested.
Port Number -- Give the port number on which the Web applications run which is usually 80. Protocol -- Mention the protocol to be used here i.e. either HTTPS or HTTP.Method -- The GET or POST method is to be mentioned here. Path -- You need to mention the path of the resource that will handle this request. Follow Redirects -- follows redirections, if any, sent by the Web application.Parameters -- This option shows the list of parameters sent with the request. You can add and remove parameters by using Add and Delete buttons.
Send a file with a request -- With the help of this option a file upload can be simulated to the Web application.
Retrieve all images and Java Applets -- This option is used to download embedded content.
Step 4: Now the format of the results is to be selected to get a page containing the results of every request by right-clicking on the Thread group node then select Add -> Listener -> View Results Tree.
Step 6: The results can been seen in the Results Tree after the completion of the Test plan. As you can seen in the picture below we have selected the first request in the upper pane and also the request which was generated with the results in the form of an HTML page with the text "Hello World!"
Step 8: To save the test plan for later use select File from the menu and then Save Test Plan (or Ctrl-S). Its preferable to save the test plan before running it.
No comments:
Post a Comment