The element of the test plan

Source: Internet
Author: User

The test plan properties are configured with a checkbox option "Functional Testing", if selected, JMeter records the data returned from the server into each sample. If a listener is selected, the data is written to file. This is useful when running the Verify JMeter is configured correctly, and the server has returned the expected value. The result is that file quickly becomes unwieldy and jmeter performance becomes worse. If you are testing a stress test, this option should be turned off and unchecked.

Threading Group Thread Groups

The thread group is the root node of all test plans, and all controllers and sample are under the thread group, and other elements, such as listener, must be placed directly under test plan to ensure that it can be used for all thread groups.

The thread group allows you to:

    1. Set the number of threads
    2. Set the transition period
    3. Set the number of times to perform tests

Each thread executes a complete test plan, completely independent of the other Test threads. Multithreading is used to simulate concurrent connections to your server application.

Transition ramp-up: The time required for all threads to complete, if there is a total of 10 threads, the ramp-up time is set to 100 seconds and 10 seconds for each thread to run. The transition takes a long enough time to avoid a test that is too much work.

Controller controllers

Includes samplers Controller sampler and Logical Controllers logic Controllers, which are the two driver test processing.

1 Samplers Controller Sampler

Tell JMeter to send a request to the server and wait for the response. They are executed in the order in which they appear in the tree.

For example, add an HTTP request sampler to send an HTTP call. You can also customize a request by adding a configuration element for one or more samplers.

Includes the following samplers:

    1. FTP Request
    2. HTTP Request
    3. JDBC Request
    4. Java Object Request
    5. LDAP Request
    6. Soap/xml-rpc Request
    7. WebService (SOAP) Request

Each sampler has several properties that need to be set up, and you can further customize a sampler by adding one or more configuration elements to the test plan.

If you are sending multiple requests of the same type (for example, HTTP requests) to the same server, consider using a default configuration element. Each controller has one or more default element.

Remember to add a listener to your test plan to view your requests and/or store the results on disk.

If you are interested in having JMeter perform basic validation in response to your request, add a assertion to sampler. For example, stress tests a Web app, the server returns "HTTP Response" code, and the page may have errors or missing parts. You can add assert checks for specific HTML tags, common string errors, and so on. JMeter allows you to create an assert using regular expressions.  

2 Logical Controllers Logic Controller

The logical controller determines when the request is sent. For example, you can add an interleaved logical controller that alternately samples two HTTP requests.

Logical controllers can change the order of requests from their child elements. They can modify requests, make JMeter repeat requests, and so on.

To understand the impact of a logical controller on a test plan, consider the following test tree:

    • Test Plan
      • Thread Group
        • Once only Controller
          • Login request (an HTTP request)
        • Load Search Page (HTTP Sampler)
        • Interleave Controller
          • Search "A" (HTTP Sampler)
          • Search "B" (HTTP Sampler)
          • HTTP Default request (Configuration Element)
        • HTTP Default request (Configuration Element)
        • Cookie Manager (Configuration Element)

1. The first thing to do is to execute a login request. Subsequent iterations will skip the request because the once only controller executes once.

2. After logging in, the next sampler loads the search page (imagine a Web application, after which the user logs in and then goes to a search page to do a search). This is just a simple request, without any logic controller filtering logic.

3. After loading the search page, we will do a search. In fact, we want to do two different searches, and we want to reload the page to search for both pages. We can do this by 4 simple HTTP request element (load search page, search "A", load search page, search "B"). We use the Interleave controller to pass one child request at a time.

The element of the test plan

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.