JMeter Simple example of a stress test +badboy script recording (results of a simple Web user login test)

Source: Internet
Author: User



JMeter installation: Download on the Internet, after the download zip decompression, found in the bin directory Jmeter.bat file, double-click to run JMeter.



http://jmeter.apache.org/






Download the JDK package before using JMeter to configure the Java environment. (See the Java Environment Configuration tutorial)






After the configuration is complete, check java-version in the Run window to determine the Java environment configuration is complete.









First, using Badboy for automatic script recording






Download Badboyinstaller-2.2.5.exe and install



: http://download.csdn.net/download/qq_28477081/8788911






Open Interface after completion






After entering the URL in the Address bar, click the Record button.






Recording steps: Home--Login, enter user name and password, click the login button, home






After you finish recording, save the document as: Export to JMeter, and generate a. jmx file.









Second, the use of jmeter for pressure testing






Open the. jmx file that you just saved through Badboy in JMeter









Leave the content you want to test and delete some of the extra content from the recording process.









Set up thread groups and listeners:



Thread groups: Set the three parameters of a thread group to be defined as: number of threads, ramg-up Period (in seconds) (interval), Number of cycles









Assertion: Sets the response assertion, which is used to check for correct response results at important nodes.



Set the response assertion: (The response assertion for the example here is to check if the logged-on page has a user login information identifying "Usr-name")






To view the assertion results:












Listener: The component that displays the results of the sampler. In order to observe the response content from the provided sampler, you can add the "observation result tree" listener, in order to visualize the response time, you can add "graphical results" to view the complete test results and pass rate, you can add "aggregation report."









Ps:csv settings for Data set config (import parameters from CSV table)









1. Create a CSV file, the contents of the parameter set of values, each parameter occupies a column, the first line begins to write the parameter value, do not write the parameter name, test the user. The first column of CSV is e-mail, the second listed password



2. In the Http://zkread.com/login test plan, right-click to add a "config element", "CSV Data Set config"



Complete path to the CSV file at 3.Filename



(Local server operation, fill in CSV full path; Remote server operation, place CSV file in JMeter Bin directory, fill in file name directly)



The variable name is filled in 4.Virable names, separated by commas if there are multiple variables in the CSV file









Set the CSV data set config in the Http://zkread.com/login test plan to refer to the values in CSV when the value is filled ${username}









When the above settings are complete, click the button to start the test.












Third. analysis of the results of jmeter operation






The result of a simple Web user login test:






1. Interpretation of content in aggregated reports






#Samples: Indicates how many requests you have made in this test, and if the test plan simulates 10 users, each user iterates 10 times, this will show 100



Average: Average response time-by default is the average response time for a single Request, and when a transaction controller is used, the average response time can also be displayed in transaction units



Min: Minimum response time



Max: Maximum response time



error%: Error rate, number of requests with errors in this test/total number of requests



Throughput: Throughput--By default, indicates the number of requests completed per second (request per Second)



Kb/sec: The amount of data received from the server side per second






2. View the result tree



All HTTP requests are green, indicating that the request was successful and red if the request failed, and the result tree can also view the response return data.









JMeter Simple example of a stress test +badboy script recording (results of a simple Web user login test)


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.