In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Understand the requirements:
1. In the process of performance testing, we often need to test the performance of the streamlined business, which involves many interfaces. At this time, asking the developer to get the interfaces and parameters will reduce the work efficiency, and directly using the recording function of jmeter can improve the work efficiency.
2. In the development interface case, we often encounter some interface functions such as upload, download, import and so on. If these scripts are not convenient to ask the developer to get the interface and parameters directly, the direct recording efficiency will be higher.
3. Baidu network disk shares a recording template, common test components have been added, and common unnecessary requests have been added in the exclusion mode. For more information on how to download the recording template, see the introduction at the end of the article.
Configure the browser agent to open the IE browser, and then click the tool "Internet options"
Click the connection tab and click the LAN Settings button
In the proxy server column, check LAN to use the proxy server, enter the address: localhost, the port you want to set the proxy port, this article set to 8888, and then click the OK button
2. To start the recording script, we first configure the interface language, which defaults to English. Modify the jmeter.properties file in jmeter's bin directory, line 37 # language=en is changed to language=zh_CN, and each time you open the jmeter, it will be displayed as a Chinese interface, as follows
During recording, the possible recording request parameters will display garbled codes, and you also need to add sampleresult.default.encoding=UTF-8 to the jmeter.properties file, as shown in the following figure.
To open jmeter by double-clicking the jmeter.bat file in the bin directory, you first need to right-click on the test plan and click "add non-test components" HTTP proxy server.
Enter the port configured in ie in the port, and select put each group in a new transaction controller in the group (create a new transaction controller in each new group to make it easy to distinguish the recording request function)
Right-click the test plan to add a "Threads" thread group to add a thread group
Right-click the thread group "add Logic Controller" recording controller to add recording controller
Then click the HTTP proxy server and click the start button to turn on the recording function. At this time, you open the browser, log in to the system you want to test, and all the operations will be recorded.
The script is recorded as follows, delete the unwanted script, and then debug it
During recording, the interface may prompt "your connection is not a private connection". In fact, you need to update the crt certificate of jmeter.
Open the IE browser and click the tool "Internet options" content "Certificate" trusted root certificate authority "Import" next step
Click the browse button, select the crt certificate under the bin directory, then click next, and then click next until you click finish.
At this point, the Baidu page that reported the error is re-opened and displayed normally, and the recording is successful.
Configure recording script exclusion and inclusion modes
In the process of actually recording a script, we may record a lot of unwanted website requests, or some unneeded requests such as js or css. Then we can filter the requests through exclusion and inclusion mode, so that the recorded script will be more concise and improve the efficiency of the development case.
Set the regular expression for the exclusion mode:
1. Exclude requests of .js ending type
. *\. Js
2. If you need to exclude more types, use regular syntax and add them, as shown below
(? I). *\. (bmp | css | js | gif | ico | jpe?g | swf | eot | otf | ttf | woff | woff2 | do | query) (? I). (bmp | css | js | gif | jpe?g | png | swf | eot | otf | ttf | mp4 | woff | woff2 | do | query) [\;]. *
3. Sometimes recorded scripts need to exclude requests at the end of mongodb, such as the following figure
The regular expression needs another line, as shown below, indicating that all interface addresses ending in mongodb are excluded.
. * mongodb
Set the regular expression that contains the pattern:
1. Record only the request for the www.baidu.com domain name
. * www\ .baidu\ .com. *
2. If you need to record a request for multiple domain names, just use regular | connection, as shown below.
. * www\ .baidu\ .com. * |. * www\ .Google\ .com. *
3. In this way, only requests from Google and Baidu will be recorded, and requests from other websites will be filtered out
4. Add debug sample to the debugging script to debug. Right-click on the thread group "add > Sample" Debug Sample
Add the view structure tree, right-click the thread group "listener" to view the result tree
Click the start button to see whether the fetched variable is successful in the view result tree.
This chapter describes how to record app requests on iOS
1. Currently, the APIs contacted by the app end are all via https, so you need to install the certificate, that is, the ApacheJMeterTemporaryRootCA.crt of jmeter's bin directory. You can send the certificate to the phone, and then install it.
two。 As shown below, I personally test and send it to the QQ phone, and then use QQ Browser to open it, and the installation can be successful.
3. After the installation is complete, you need to turn on _ DO NOT INSTALL unless this is your certificate after setting the "general" about native "certificate trust setting."
4. Go to the setting "generic" description file and device management to see if _ DO NOT INSTALL unless this is your certificate shows that it has been verified. If so, you can make a recording request.
5. When the phone is already connected to wifi (the connected wifi network needs to be the same as the computer's network), click to manually enter the computer ip, and the port is the same as the HTTP proxy port of jmeter, as shown below
6. Start the recording button and operate on the app side to successfully record the request.
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.