当前位置:网站首页>Day21 JMeter usage basis
Day21 JMeter usage basis
2022-06-25 05:52:00 【Small fish】
Jmeter
Jmeter Directory structure
- bin Catalog : Store executable files and configuration files
- jmeter.bat:windows Startup file for
- jmeter.log: Log system
- jmeter.sh:linux Startup file for
- jmeter.properties: System profile
- jmeter-server.bat:windows Server configuration for distributed testing
- jmeter-server:linux Sub weapon configuration for distributed testing
- doc and printable docs Catalog : Main storage Jmeter Of API Help document
- lib Catalog : This directory is used to store Jmeter Rely on the jar Packages and user extensions depend on jar package
Jmeter Basic configuration
- Language settings
Method 1. Modify language in options
Method 2. Installation directory bin Under the table of contents , stay jmeter.property In file , modify language=zh_CN
If the response data contains Chinese garbled code , Need modification jmeter Of jmeter.properties In the document , hold sampleresult.default.encoding Set to UTF-8, You need to restart after the change
Jmeter Basic usage process
Use jmeter send out get request , And view request and response information
- start-up Jmeter
- Add thread group under test plan
- Add... Under thread group HTTP Request sampler
- Fill in ‘HTTP request ‘ Related request data for
- stay “ In thread group ” Add below “ View the result tree ” Monitor
- Click on “ start-up ” Button to run , And look at the results

Jmeter Components
- Common components
Thread group : The user simulates multithreading , A thread represents a user operation
The configuration element : Initialize the test environment and test data , Similar to the setup
Preprocessor : Preprocess the data to be sent , Similar to parameterization in automated scripts
Sampler : Send a request to the server , Similar to sending a request in an automated script
Post Processors : Process the received server response data , It is similar to the operation of getting a specific field in the response in an automated script
Assertion : Compare the received response results with the expected results ,
Consistent with assertions in automated scripts
Monitor : View the results and logs of the test script run , Similar to test reports in automated test scripts
Timer : Wait for a while , Similar to... In automated test scripts sleep
Test piece : Code blocks that encapsulate basic functions , Not executed separately , Script is required to call , Similar to functions encapsulated in Automation
- Component scope
The principle of determining the scope of a component :
- stay JMeter in 2, The scope of components is determined according to the parent-child relationship of components in the tree structure of the test plan
- The sampler in the element is the core , Other components operate with the sampler as the core , Components are added in different locations , The effective sampler is also different .
Sampler : The sampler is an independent request , Do not interact with other components , So there's no scope problem ;
Logic controller : This element only acts on the sampler and logic controller in its child nodes
The other six components : In addition to sampler and logic controller elements , If it is a child node of a sampler , Then the component acts on its parent and child nodes
If the node sampler is not its parent , Then its scope is all other descendant nodes under the parent node of the component ( Child nodes including child nodes )

if The controller gets only for its child nodes http request 3 Work , When the conditions are met if Controller http request 3 To perform
Look at the fruit tree 2 yes http request 2 So he only has to http2 Work
Look at the fruit tree 1 The parent node of is not a sampler ( Is a thread group ) So it works on all descendant nodes under the thread group , So he can see http request 1、2、3 Result
- Component execution sequence
- The configuration element
- Preprocessor
- Timer
- Sampler
- Post Processors
- Assertion
- Monitor
Jmeter Basic components
- Key components
- Thread group
- HTTP Sampler
- View the result tree
- Cookie Manager
Thread group
A thread group is a control JMeter The number of threads that will be used to execute the test , A thread can also be understood as a test user , A thread group is a group of users
Characteristics of thread group :
- Set the number of threads ( Simulate multi person operation )
- Sampler ( request ) And logical controllers must rely on thread groups to use
- Thread groups can add multiple threads , Multiple thread groups can be parallel or serial
- Components under other components can be added under the thread group
Classification of thread groups :
- Thread group : ordinary 、 Common thread groups , Think of it as a virtual user group , Each thread in the thread group can be understood as a virtual user
- setUp Thread group : A special type of thread group , Can be used to perform pre test operations , Anyone who setup The thread group must execute first
- tearDown Thread group : A special type of thread group , Can be used to perform post test work , Anyone who tearDown The thread group must be the last to execute
Property configuration of thread group
Action to be performed after sampler error :
- continue : If the execution in the sampler fails due to errors , Request will not stop , Carry on .
- Start the next thread loop : If something goes wrong , The remaining requests in the same thread will no longer be executed , Start a new iteration directly .
- Stop thread : Only the current thread stops , It does not affect the execution of other threads . This item is not normally set .
- Stop test : The current thread will end after all the threads are executed
- Stop testing now : Stop all thread operations immediately

边栏推荐
- Introduction to MySQL test run test framework
- ERDAS 9.2 installation tutorial
- Is the securities account of Qiantang education safe? Is it reliable?
- What happens when you use "-fno exceptions", "new T"- With “-fno-exceptions”, what happens with “new T”?
- Technology inventory: past, present and future of Message Oriented Middleware
- Vscode voice notes to enrich information (medium)
- How do product managers get started? How do they learn when no one takes them?
- SAP Fiori tools and corresponding cli (command line interface)
- Day17 (set)
- CSDN cerebral palsy bug has wasted nearly two hours of hard work
猜你喜欢
Introduction to sap ui5 tools

MySQL tuning -- 02 -- slow query log
SAP ui5 tutorial for beginners part XXVI - detailed steps for using OData service with mock server trial version

05 virtual machine stack
The locally developed SAP ui5 application is deployed to the ABAP server to perform error analysis

Deep learning non local neural networks

【LeetCode】40. Combined summation II (2 strokes of wrong questions)
Interviewer: what is an iterator? What is the relationship between async await and iterators?

Day18 (set, generic, hash table, tree, stack and queue, graph, array and linked list)
Websocket in the promotion of vegetable farmers
随机推荐
JSON Library Tutorial from scratch (III): parsing strings, learning and sorting notes
05 virtual machine stack
Go quiz: considerations for function naming return value from the go interview question (more than 80% of people answered wrong)
MySQL uses the where condition to find strange results: solve
Vscode voice notes to enrich information (Part 1)
What is SAP sup - Sybase unwired platform
BUUCTF(web:1-50)
Use of arrays tool class
Voxel based and second network learning
Semantic segmentation cvpr2020 unsupervised intra domain adaptation for semantic segmentation through self supervision
JMeter stress testing and agent recording
How SAP ui5 device type detection device API works
2.20 learning content
Kyma application connectivity feature introduction
[OSPF routing calculation (class I LSA router, class II LSA network, and class III LSA sum net)] -20211228-30
Instant messaging project (I)
Linus' speech recordings, which were lost in 1994, were made public
C language -- Sanzi chess
手机开户一般哪个证券公司好?手机开户是安全么?
Use generator-easy-ui5 to quickly create the engineering structure of SAP ui5 applications