jmeter- create a test plan

One. Create a test plan

In this section, you will learn how to create a basic test program to test the site. You will create 5 users to Jakarta sends a request two pages on your site. Of course, you can also allow users to send twice each.

Thus, the total number of requests is :( . 5 users) X- ( 2 requests) X- (repeated 2 times) = 20 th HTTP request. To create the test plan, you need to use the following components:

Thread Group , HTTP default request value, HTTP requests and graphical results.

 

5.1 Add User

 

Processing each JMeter first step in the test plan is to add a thread group elements. The Thread Group tells JMeter the number of users you want to virtual, frequency and the number of sending a request to send the request.

 

Continue, first of all, select the test program, right-click to select the Add menu, and then select the thread group.

 

Next, you need to modify the default value, if you do not select it, then select the thread group in the tree. You should now be in JMeter see the Thread Group Control Panel (see below) to the right of the window.

 

First to this thread group a meaningful name, in the name field, enter Jakarta Users.

Then, enter the number of threads in 5.

The next input field, Ramp_Up Period, remains unchanged. This value tells JMeter delay between the start how long each thread. For example, if you enter 5 , the JMeter will be 5 to complete all operations of the thread of seconds ago. So, if we have 5 threads and 5 Miao Ramp_Up Period , the delay between the start of the thread will be 1 second ( 5 threads / 5 Miao = 1 second). If you set this value to 0 , the JMeter will immediately start all operations of this thread.

Finally, remove the number of cycles of complex options "forever", then enter 2 . This value tells JMeter your test is repeated many times. If you enter 1 , then JMeter will run your tests again. To stop running your test plan, select the "forever" checkbox.

 

5.2 increase in the default HTTP request attributes

We have defined users, and now they want to define the tasks to be performed up. In this section, you will be on your HTTP request specifies the default settings.

From the selected Jakart Users this element starts, right-click to select "Add" menu, and then select the "Configuration element" -> the HTTP request any default value. Then, select the elements that look at the control panel (see below).

 

HTTP request default value to any element not tell JMeter to send an HTTP request. It is simply defined HTTP request to the default values of some elements used.

 

 

5.3  increase in HTTP request

In this test plan, we need to implement two HTTP requests. The first is Jakarta Home ( http://jakarta.apache.org/ ) , the second is Project Wizard page ( http://jakarta.apache.org/site/guidelines.html ) .

JMeter according to their order of appearance in the transmission request tree.

First to Jakarta Users adding the first element a HTTP request ( Add -> Sampler -> HTTP request ) . Then from the tree HTTP requests and modify the positive attributes and elements (see below).

1 . Change the name of the domain is "home."

2 . Set path to " / ." Note that you do not have a domain name server design, because you already HTTP default set over any one of a request element.

 

Next, add every two HTTP request, and then edit the following properties.

 

1 . Change the name of the domain to "project policy."

 

2 . Set path to " /site/guidelines.html ."

 

5.4 Add Monitor to view the test results

Finally, you need a plan to add components to the test is a monitor. This element is used to all the HTTP requests a file to store the results and data showing the visual model.

Select Jakarta Users element, and then add a graphics monitor results (add -> Monitor -> graphical results). Then, you need to specify a directory and an output file name. You can enter the domain name to a file, you can also select "Browse" button to browse the directory and enter a file name.

5.5  Save the test plan

Although this is not necessary, but we intended to build before you run the test program will save it in a file inside. To save the program, select the menu "File" -> "Save Test Plan" to save.

JMeter allows you to save the entire Test Plan tree, part of the base can also be saved only. To save some of the elements in the special branch, first select a starting member of the branches, and then select Save as menu items in the right pop-up menu. Similarly, suitable elements may be selected, and then selecting the Edit menu in the "Save As."

 

5 . Running a Test Plan

In selecting "Start", "Run" menu.

If the test is run correctly, the JMeter will show a green rectangular area above. At the end of all the tests, it will be grayed out. Even after you choose the "Stop", the green light will remain until the end of all the threads.

If you want to stop the test program is running, select "Run" menu in the "stop."

If you select a file to save the results of your listeners, then you will have a file that can be opened in any view. Each view will display the results of its own way.

The same file can be opened in multiple views, this is no problem. During the test run, the JMeter sure that no example was repeatedly saved in the same file.

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/linxiu-0925/p/11535185.html