In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
The WebSocket interface needs to download the corresponding patch plug-in before it can be tested. For the download method, please see the end of the article.
First, add thread groups, add thread groups and other components to 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 CSV data file settings component, which can be used for parameterization, right-click "add configuration component" CSV data file settings
Add a user-defined variable that can be called throughout the thread
2. Add the following request in turn
Add create connection request-select the thread group, right-click to add "Sampler" WebSocket Open Connection
The purpose of this request is to create a connection with the websocket interface for other interfaces to connect, and then send the request to the server. The configuration is as follows:
Add send request-select thread group, right-click to add "Sampler" WebSocket request-response Sampler
The function of the request is to send the request to the server, and the server processes the request, as configured as follows
Add read request-select the thread group, right-click to add "Sampler" WebSocket Single Read Sampler
The function of this request is to read the request returned by the system, and set the loop according to the developed code. For example, if the development code sends a request-response Sampler request and the system returns 1000 requests, you need to set the number of cycles to 1000 for performance test. If you only need to automate the test for the interface, you can configure it as follows:
Add an assertion to determine whether the response contains {'dataType':'testResponse','msg':' return information, select the WebSocket request, right-click, add "assertion" response assertion, and enter the expected result
Add loop controller step, right-click to add "logic controller" loop controller
Add shutdown request-select the thread group, right-click to add "Sampler" WebSocket Close
This request is used to shut down the connected websocket interface, which is configured as follows
Third, add the view result tree to view the response data of each response result, select the thread group, right-click, and add a "listener" to view the result tree.
After the script is developed, it can be used for performance testing or interface automation testing.
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.