Jmeter-building a Web test plan (1)

Source: Internet
Author: User

Because the project I'm in touch with is web, it's a priority to start by creating a Web test plan.

Official Tutorial Address:

Http://jmeter.apache.org/usermanual/build-web-test-plan.html

In this section, we'll learn how to create a basic Test plan to test a Web site. You'll create five users that send requests to and the Jmeter Web site. Also, you'll tell the user to run their tests twice. So, the total number of requests is (5 users) * (2 requests) * (Repeat 2 times) =20 HTTP requests. To construct the Test Plan, you'll use the following Elements:thread Group, HTTP request, HTTP request Defaults, and Gr APh Results.

1. Adding Users

The first step you want to does with every JMeter Test Plan are to add a Thread Group element. The Thread Group tells JMeter the number of users want to simulate, how often the users should send requests, and the How many requests they should send.

Go ahead and add the Thread Group element by first selecting the Test Plan, clicking your right mouse button to get the Ad D menu, and then select Add->threadgroup.

You should now see the Thread Group element under Test Plan. If you don't see the element and then "expand" the test plan for the tree by clicking on the test plan element.

Next, you need to modify the default properties. Select the Thread Group element in the tree and if you have not already selected it. You should now see the Thread Group Control Panel in the right section of the JMeter window.

Start by providing a to descriptive name for our Thread Group. In the Name field, enter Jmeter Users.

Next, Increse the number of users (called threads) to 5.

In the next field, the Ramp-up Period, leave the default value of 1 seconds. This property tells Jmeter how long-to-delay between starting each user. For example, if you enter a ramp-up Period of 5 seconds, Jmeter would finish starting all of your users by the end of the 5 Seconds. So, if we had 5 users and a 5 second ramp-up Period, then the delay between starting users would be 1 second (5 USERS/5 seconds = 1 user per second). If you set the value to 0, then Jmeter'll immediately start all of the your users.

Finally Enter a value of 2 in the Loop count field. This prepertly telss Jmeter hwo many times to repeat your test. If you enter a loop count value of 1 and then JMeter'll run your test only once. To has JMeter repeatly run your Test Plan, select the Forver checkbox.

Note:in Most of applications, you had to manually the accept changes you do in a Control Panel. However, in JMeter, the Control Panel automatically accepts your changes as your make them. If you change the name of an element, the tree is updated with the new text after you leave the Control Panel (for ex Ample, when selecting another tree element).

See below figure for the completed JMeter Users Thread Group.

2. Adding Default HTTP Request Properties

Now, we have defined our users, it's time to define the tasks that they'll be performing. In this section, you'll specify the default settings for your HTTP requests. And then, under next section, you'll add HTTP Request elements which use some of the default settings your sepcified here.

Begin by selecting the Jmeter users (Thread Group) element. Click Your right mouse button to get the Add menu, and then select Add-, Config Element, and HTTP Request Defaults. Then, select the new element to the view its Control Panel.

Like most JMeter elements, the HTTP Request Defaults Control Panel have a name field that you c a modify. In this example, leave this field with the default value.

Skip to the next field, which is the Web Server name/ip. For the Test Plan, which is building, all HTTP requests'll be sent to the same Web server, jmeter.apache.org. Enter the domain name into the field. This is the only field that we'll specifiy a default, so leave the remaining fields with their default values.

Note:the http request Defaults element does not the JMeter to send an HTTP request. It simply defines the default values, the HTTP Request elements use.

Jmeter-building a Web test plan (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.