当前位置:网站首页>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

边栏推荐
- SAP ui5 beginner tutorial No. 28 - Introduction to the integration test tool OPA for SAP ui5 applications
- Solve some prompt codes that pychar cannot recognize selenium
- BUUCTF(web:1-50)
- How to add an external header file in vs?
- Pytorch- daily learning notes of some small functions involving training
- Excel splits a worksheet into multiple worksheets according to conditions, and how to split multiple worksheets into independent tables
- Word of the Day
- First blog
- A method of automatic continuation of previous tables in word table
- What happens when you use "-fno exceptions", "new T"- With “-fno-exceptions”, what happens with “new T”?
猜你喜欢

Code learning-cvpr2020 unsupervised domain adaptive semantic segmentation: intra advance

2022.1.23 diary
![The k-th node of the binary search tree [sword finger offer]](/img/9c/26b508100d8b49c114cf72346a8e7c.jpg)
The k-th node of the binary search tree [sword finger offer]
SAP ui5 application development tutorial 32 - how to create a custom SAP ui5 control

Array introduction plus example 01

Semantic segmentation cvpr2019-advance: advantageous enterprise minimization for domain adaptation in semantic segmentation

C language -- Sanzi chess
Introduction to the main features of kyma when the cloud native application runs

Voxel based and second network learning

【LeetCode】40. Combined summation II (2 strokes of wrong questions)
随机推荐
Interface learning
[golang] leetcode intermediate - Search rotation sort array & search two-dimensional matrix II
SAP ui5 beginner tutorial No. 27 - unit test tool quNit introduction trial version for SAP ui5 application
Pytorch- daily learning notes of some small functions involving training
Which securities company is good for opening a mobile account? Is it safe to open a mobile account?
Japanese fifty tone diagram
[pan Wai 1] Huawei computer test
Aiot project that is an introduction to the basics of the Internet of things and can be implemented in practice
SAP ui5 beginner tutorial 25 - using proxy server to solve the cross domain problem of SAP ui5 application accessing remote OData service trial version
Interviewer: what is an iterator? What is the relationship between async await and iterators?
Mirror image of binary tree
Depth of binary tree
Trouble of setting table property to null
Trial version of routing history and routing back and history of SAP ui5
Introduction to sap ui5 tools
Technology Review: Interpretation of cloud native architecture trend in 2022
Transformations of pytorch torch torch vision
Volatile and JMM memory models
MySQL tuning -- 02 -- slow query log
[untitled]