2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Jmeter is an open source stress testing tool developed by Apache based on Java. It is small in size, full-featured, easy to use, and a relatively lightweight testing tool that is very simple to use. Because Jmeter is developed in Java, you must install JDK before running it. Jmeter is free to install. You can use it directly by unzipping the installation package. It can be used on Linux / Windows / MacOS.
Jmeter can do interface testing and stress testing. Simple operations of interface testing include http scripting (sending get/post requests, adding cookies, adding headers, adding permission authentication, uploading files), webservice scripting, parameterization, assertion, association (regular expression extractor and processing json-json path extractor) and jmeter database operation, etc.
https://jmeter.apache.org/download_jmeter.cgi
Example interface:
API address: https://api.oioweb.cn/api/common/OneDayEnglish
Return format: JSON
Request method: GET
一、选择测试计划 👉 右键 👉 添加 👉 线程 👉 线程组
Threads: Number of virtual users. One virtual user occupies one process or thread.
Preparation time: How long does it take to start all the set virtual users? If the number of threads is 20 and the preparation time is 10, it takes 10 seconds to start 20 threads. That is, 2 threads are started per second.
Cycles: The number of times each thread sends requests. If the number of threads is 20 and the number of loops is 100, then each thread sends 100 requests. The total number of requests is 20*100=2000. If "Forever" is checked, all threads will continue to send requests until you choose to stop running the script.
二、添加HTTP请求:选择线程组 👉 右键 👉 添加 👉 取样器 👉 HTTP请求
Fill in the request parameters
三、查看结果:选择HTTP请求 👉 右键 👉 添加 👉 监听器 👉 查看结果树
4. Start Click the green start button and click View Result Tree to view the returned results (save before starting)
Select JSON in the text format on the left
The right side shows the response result