"Go" JMeter Getting Started instance

Source: Internet
Author: User

People from the understanding of things have a specific to the abstract process, learning JMeter is no exception, through an example to learn, on the one hand can let beginners see that is the confidence, on the other hand, but also in the hearts of beginners left a hazy impression of this thing, which in the later study, will continue to be deepened.

So, let's not give any detailed description of any of the parts of Jmeter, but use an example to get an idea of the framework.
Preparation for the first stage

First of all, you have to go to the official download Jmeter Compressed package, the official address is http://jmeter.apache.org/, in addition, your system to configure the Java Environment, the author wrote this article, the official version is 2.8, after downloading, enter the inside bin directory, find Jmeter.bat This batch file, and then double-click to enter jmeter 's working interface:

There are a lot of features in this, so let's not go into this one, and then we'll step through the creation of a web test project, so that we can begin to understand the framework from the perceptual.

Next, the project we created is like this, and we're going to set up a plan that will allow it to access the URLs we've set up and return the information we have access to.

First, we want to create a new thread group, the role of the thread group to simulate multiple Access objects, the system can be stress testing, here we first have this concept on the line.


And then we're going to add a foreach logical unit underneath these thread groups, which will help us traverse the URLs we want to access.

After adding the forEach Logical units, we'll set some properties.

Here is the meaning of the above parameter

Name: Controller names

Comments: Remarks

Input Variable Prefix: Enter variable prefix

Output variable name: Export variable name

Add "_" before number: Enter the variable name for the interval using "_".

The URL here is the variable you want us to enter, and ReturnVal is the value that will be output each time you traverse a variable that is prefixed by a URL.

A lot of people here will start to wonder, then where does this URL come from?

Such as

Right-click the forEach Logical control and add a user-defined variable. Add the URLto be loaded later, here I added two URL- prefixed URLs, to be ForEach The control will traverse these variables from here.

Well, with the data, in fact, we are missing one thing, we are to make a request to visit the page, in fact, there is a request to launch a control. Here we add an http request.

To click on this HTTP request, we now only need to add one item.

This ${} represents the meaning of the value,returnval actually and the returnval in the previous ForEach Control So that we can understand the whole process.

For each http request, it takes the value of the returnval in the forEach control , and returnval The value is derived from the traversal result of the value prefixed to the URL .

Write here, actually almost, but, there is one thing, is how to see the results, here we add a listener, return the results, we can see the results of the response. , we add a view result tree.

Then click on the Run button in the menu bar and you will need to save it first time.

The last directory tree on the left should be like this.

After running, click View Results tree, you can see the following figure.

Readers may find it strange why one is green and one is red.

The green indicates that access is results, and red is unsuccessful in accessing it. Here we visited two requests, one is http://www.baidu.com, the other is http://www.google.com, Baidu here is a successful visit, but, in the author's writing this article when , just is not successful, the reason, do not say, you also understand, there are readers may be more confused, why visit Google , will appear below the URL ? I suspect that in mainland China to visit Google, the default will be redirected to the Hong Kong side of the Google server, as for why, may be Google There is no use in the mainland on this side. All right, I'll write about it this time.

"Go" JMeter Getting Started instance

Related Article

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.