In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
First, add components such as thread groups. Add thread groups. Jmeter execution is driven by thread groups. The test plan must have at least one thread group. Select Test Plan, right-click, and add "Threads" thread group.
Add user parameters to the online program group, the user can use this component to set the parameters and parameterize them in the sampler. The user (thread) can distinguish the parameterized values according to the user, select the thread group, right-click, add the "pre-processor" user parameter, fill in the name of the call, and the value of the variable.
Add HTTP header manager add HTTP header manager, header manager is used to maintain the interface header, you need to use this component for maintenance, select the thread group, right-click, add "configuration element" HTTP header manager, fill in the header information x-auth-token, Content-Type, etc.
Add HTTP request default value add HTTP request default value, the function of this component is to encapsulate the duplicate part, set it to be used multiple times at a time, select the thread group, right-click, add "configure component" HTTP request default value, fill in the protocol, server name / ip, port number, you can not enter this option in the HTTP request
Second, implement the request for new inspection tasks
The analysis request API can be debugged by fiddle or Google browser. The request parameters are as follows. The API method is post
Get projectId (project id)
1.1 add HTTP request
Add project query API request to get ProjectId, select thread group, right click, add "Sampler" HTTP request, enter name, protocol, method and path
1.2 add JSONPath Extractor extractor select the HTTP request, right click, add "post processor" jp@gc-JSONPath Extractor, enter the name of the extracted variable, and the JSONPath expression
1.3 add the variables obtained by BeanShell PostProcessor using this method, including [], and need to add this component for cutting. Select the HTTP request, right-click, and add "post processor" BeanShell PostProcessor, which can be cut in Java language.
1.4 add assertions to determine whether the response message contains {"code": 0, "msg": "SUCCESS", select the HTTP request, right-click, add "assertion" response assertion, and enter the expected result
Get repoId (warehouse id)
1.1 add HTTP request add Warehouse query API request associated with the project, which is used to obtain repoId, select thread group, right-click, add "Sampler" HTTP request, enter name, protocol, method and path
1.2 add JSONPath Extractor extractor select the HTTP request, right click, add "post processor" jp@gc-JSONPath Extractor, enter the name of the extracted variable, and the JSONPath expression
1.3 add the variables obtained by BeanShell PostProcessor using this method, including [], and need to add this component for cutting. Select the HTTP request, right-click, and add "post processor" BeanShell PostProcessor, which can be cut in Java language.
1.4 add assertions to determine whether the response message contains {"code": 0, "msg": "SUCCESS", select the HTTP request, right-click, add "assertion" response assertion, and enter the expected result
Implement interface request
1.1 add HTTP request add new check task API request, select thread group, right-click, add "Sampler" HTTP request, enter name, protocol, method, path, parameter. In this case, you need to replace the previously obtained parameter values with variable format. Jmeter can reference the generated variables using the ${projectid} format.
1.2 add an assertion to determine whether the response message contains {"code": 0, "msg": "SUCCESS"}, select the HTTP request, right-click, add "assertion" response assertion, and enter the expected result
Add listeners add view result tree view result tree to view the response data of each response result, select thread group, right-click, and add "listener" to view result tree
Add the aggregate report aggregate report to see the results and graphical results displayed in the table, and count the number of times executed by the sampler (request), average response time, minimum response time, maximum response time, throughput, select thread group, right-click, add listener aggregate report
if the article is helpful to you, you can click on the follow function in the lower right corner. Welcome to forward and clap the brick. I will continue to launch articles related to the test and share the testing technology with you. Every original article is written attentively to put an end to plagiarism and copying. The official Wechat account is synchronized with the articles on this platform for easy reference.
QQ technology exchange group: please enter the verification information 51CTO to add the group.
Wechat QR code follow official account:
After following, reply to the resource download, and you can get the download address of all kinds of resources shared by yourself.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.