Stress testing script generation method, device, equipment and medium based on automatic packet capture
Through automatic packet capture technology, using Fiddler and JMeter plug-in configuration to generate JMeter scripts, the problem of inefficient writing JMeter scripts in the existing technology is solved, and efficient pressure test script generation and stress testing are achieved.
Patent Information
- Application Number
- CN202111536951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, manual writing of JMeter scripts is adopted to have high professionalism and low writing efficiency for script writers, which leads to difficulty in generating pressure test scripts.
Through automatic packet capture, Fiddler and JMeter plug-ins are used to configure the plug-in, obtain keywords and keyword values in the development document data, and generate JMeter scripts. The main conversion work is concentrated in the Fiddler plug-in to reduce manual intervention.
It reduces the difficulty of script generation, improves the generation efficiency, and realizes efficient acquisition of stress test results.
Smart Images

Figure CN114238053B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stress testing for R&D management, and in particular to a method, device, computer equipment, and storage medium for generating stress testing scripts based on automatic packet capture. Background Art
[0002] Constructing a stress testing script for the system's overall business scenarios is the most basic and time-consuming step for testers in performance testing, and is related to the adequacy of the test and the coverage of business scenarios.
[0003] JMeter scripts (test scripts in XML format) are commonly used in stress testing. Currently, there are multiple ways to generate JMeter scripts, including manual writing based on API documentation, recording with Badboy (also a script recording tool), and proxy recording. Manually writing JMeter scripts (for example, based on API documentation) requires a high level of professional expertise and is inefficient. Summary of the Invention
[0004] The embodiments of the present invention provide a method, apparatus, computer equipment and storage medium for generating stress testing scripts based on automatic packet capture, aiming to solve the problem in the prior art of manually writing JMeter scripts by referring to API documents, which not only requires high professionalism of script writers but also has low writing efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a stress testing script based on automatic packet capture, which includes:
[0006] In response to a stress testing instruction, obtaining an object to be tested corresponding to the stress testing instruction;
[0007] Obtain first plug-in data, and configure the plug-in according to the first plug-in data to obtain first stress testing plug-in data;
[0008] Obtain second plug-in data, and configure the plug-in according to the second plug-in data to obtain second stress testing plug-in data;
[0009] If it is determined that the development document data of the object to be tested is not a null value, the development document data is obtained, keywords and keyword values are extracted from the API document data in the development document data, and the keywords and keyword values are used to form a first request body sample data;
[0010] Converting and generating scripts on the first request body sample data according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a first conversion script; and
[0011] A stress test is performed on the object to be tested using the first conversion script to obtain a first stress test result.
[0012] In a second aspect, an embodiment of the present invention provides a stress testing script generation device based on automatic packet capture, which includes:
[0013] A test object acquisition unit, configured to respond to a stress testing instruction and acquire a test object corresponding to the stress testing instruction;
[0014] A first configuration unit is configured to obtain first plug-in data, and configure the plug-in according to the first plug-in data to obtain first stress testing plug-in data;
[0015] A second configuration unit is configured to obtain second plug-in data, and configure the plug-in according to the second plug-in data to obtain second stress testing plug-in data;
[0016] A first sample data acquisition unit is configured to, if it is determined that the development document data of the object to be tested is not null, acquire the development document data, extract keywords and keyword values from API document data in the development document data, and form first request body sample data from the keywords and keyword values;
[0017] a first script generating unit, configured to convert and generate a script on the first request body sample data according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a first conversion script; and
[0018] The first testing unit is configured to perform a stress test on the object to be tested using the first conversion script to obtain a first stress test result.
[0019] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and runnable on the processor. When the processor executes the computer program, the stress testing script generation method based on automatic packet capture described in the first aspect is implemented.
[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the stress testing script generation method based on automatic packet capture described in the first aspect above.
[0021] The embodiment of the present invention provides a stress test script generation method, device, computer equipment and storage medium based on automatic packet capture. The method first configures the first stress test plug-in data and the second stress test plug-in data. Then, if it is determined that the development document data of the object to be tested is not null, the API document data therein is subjected to keyword and value extraction to form the first request body sample data. The first request body sample data is sequentially subjected to script conversion and generation according to the first stress test plug-in data and the second stress test plug-in data to obtain a first conversion script. Finally, the object to be tested is subjected to stress testing based on the first conversion script to obtain a first stress test result. This achieves the goal of concentrating the main conversion generation work of the first conversion script in the plug-in corresponding to the first stress test plug-in data. Compared with concentrating the main conversion generation work of the first conversion script in the plug-in corresponding to the second stress test plug-in data, it not only reduces the difficulty of script generation, but also improves the generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 A schematic diagram of an application scenario of the method for generating a stress testing script based on automatic packet capture provided by an embodiment of the present invention;
[0024] Figure 2 A schematic diagram of a process for generating a stress testing script based on automatic packet capture provided by an embodiment of the present invention;
[0025] Figure 3 A schematic block diagram of a device for generating a stress testing script based on automatic packet capture provided by an embodiment of the present invention;
[0026] Figure 4 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0028] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0029] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0030] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0031] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of the method for generating a stress testing script based on automatic packet capture provided by an embodiment of the present invention; Figure 2 A flow chart of a method for generating a stress testing script based on automatic packet capture provided in an embodiment of the present invention is provided. The method for generating a stress testing script based on automatic packet capture is applied to a server and is executed by application software installed in the server.
[0032] like Figure 2 As shown, the method includes steps S101 to S106.
[0033] S101 . In response to a stress testing instruction, obtain an object to be tested corresponding to the stress testing instruction.
[0034] In the present embodiment, the technical solution is described with the server as the execution subject. When the development of a certain object (such as application software, more specifically the API interface of the application software) is completed, it needs to be stress tested before going online. At this time, the object to be tested is deployed in the server. Generally, stress testing refers to running a test on an application program under the conditions of a small number of computers or a lack of system resources. The resources usually required for software stress testing include internal memory, CPU availability, disk space and network bandwidth. For example, when a large number of users access the server in a short period of time to use the services provided by the above-mentioned object to be tested are simulated, stress testing can be performed on it. In order to simulate the effect of a large number of users accessing the server in a short period of time, JMeter scripts can be used to implement it. If the JMeter script method of manual writing is directly adopted (such as manual writing with reference to API documents), not only the professional requirements of the script writer are very high, but also the writing efficiency is low. In this application, the method of automatically generating JMeter scripts can be used to improve the generation efficiency of JMeter scripts, thereby further improving the efficiency of stress testing.
[0035] S102: Obtain first plug-in data, and configure the plug-in according to the first plug-in data to obtain first stress testing plug-in data.
[0036] In the present embodiment, the first plug-in data corresponds to a Fiddler plug-in, which is an http protocol debugging proxy tool that can record and check http communications between all terminals and the Internet, set breakpoints, and view all data entering and leaving Fiddler (referring to files such as cookies, html, js, and css). When using the Fiddler plug-in corresponding to the first plug-in data, it is necessary to first configure it and deploy it to the server, and then the Fiddler plug-in can participate in the pressure testing process. In this application, in order to realize automatic generation of JMeter scripts, the first pressure testing plug-in data can share more script generation work, and before using the plug-in function corresponding to the first pressure testing plug-in data, it needs to be initially configured and can be used.
[0037] In one embodiment, step S102 includes:
[0038] Initialize and create a class library project;
[0039] Add a reference to the first plug-in data to obtain a first update class library project;
[0040] Adding preset attribute information to the assembly information in the first updated class library project to obtain a second updated class library project;
[0041] Creating at least one new class in the second updated class library project to inherit the interface exposed in the second updated class library project, to obtain a third updated class library project;
[0042] Compiling the third update class library project to obtain a first dynamic link library file, and copying the first dynamic link library file to a pre-created empty script to obtain a first script;
[0043] The plug-in configuration is performed according to the first script to obtain first stress testing plug-in data.
[0044] In this embodiment, when the plug-in function corresponding to the first stress testing plug-in data is used for initial configuration, the following process is specifically performed:
[0045] 1) Initialize and create a class library project (such as a Visual C# Class Library project);
[0046] 2) Add a reference to the first plug-in data in the Solution Explorer of the class library project (i.e., add a reference to fiddler.exe);
[0047] 3) Adding preset attribute information to the assembly information in the first updated class library project (such as the assembly information can be viewed in the AssemblyInfo.cs file) to obtain a second updated class library project; wherein the preset attribute information is [assembly:Fiddler.RequiredVersion("4.6.2.0")];
[0048] 4) creating at least one new class in the second updated class library project, so as to inherit the interface exposed in the second updated class library project through the new class, thereby obtaining a third updated class library project;
[0049] 5) Compile the third update class library project to obtain a first dynamic link library file (the first dynamic link library file can also be abbreviated as a first DLL file), and then copy the first dynamic link library file to a pre-created empty script (such as Scripts) to obtain a first script. The above copying process is performed because the DLL file needs to be placed in ImportExport when batch import and export operations are performed on requests.
[0050] After completing the above configuration process of the first plug-in data, a plug-in capable of recording and checking the request body of HTTP communication is embedded in the server.
[0051] S103: Obtain second plug-in data, and configure the plug-in according to the second plug-in data to obtain second stress testing plug-in data.
[0052] In this embodiment, the second plug-in data corresponds to a JMeter plug-in, which can be used to test static and dynamic resources such as static files, Java servlets, CGI scripts, Java objects, databases, FTP servers, etc. JMeter can be used to simulate heavy loads on servers, networks, or objects to test their strength and analyze overall performance under different stress categories. Additionally, JMeter can perform functional / regression testing on applications by creating scripts with assertions to verify that your program returns expected results. The primary work of generating JMeter scripts on the server is shifted to the Fiddler plug-in, effectively avoiding the increased operational difficulty and reduced testing efficiency caused by the JMeter plug-in operating in non-GUI mode for high-concurrency testing. Furthermore, in high-concurrency testing, since the JMeter command line is only effective for a single concurrency level, generating test reports for high-concurrency tests requires multiple scripts. The first stress testing plug-in data, however, offloads more of the script generation work, eliminating the need to develop multiple scripts to generate test reports for high-concurrency tests.
[0053] S104: If it is determined that the development document data of the object to be tested is not null, obtain the development document data, extract keywords and keyword values from the API document data in the development document data, and compose first request body sample data from the keywords and keyword values.
[0054] In the present embodiment, in order to generate JMeter scripts more accurately, it is still necessary to refer to the API document data in the development document data of the object to be tested. Generally, the development document data will include functional requirements, bidding plans, demand analysis, technical analysis, system analysis, database documents, functional function documents, interface documents, compilation manuals, QA documents (i.e., question and answer documents) and project summaries, and will also generally include API interface documents (which can be understood as API document data). In order to more quickly analyze the request body format corresponding to the API interface of the object to be tested based on the API document data, it is necessary to perform keyword extraction on the API document data in the development document data to obtain a script keyword set, and form candidate keywords of the request body format corresponding to the API interface with each script keyword included in the script keyword set.
[0055] In one embodiment, step S104 includes:
[0056] Obtaining a pre-stored interface request body keyword list and the interface request body keywords included in the interface request body keyword list, searching for target keywords having any interface request body keyword in the API document data, and forming a target keyword set;
[0057] Obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set; wherein the initial value of i is 1 and the value range of i is [1, N], where N is the total number of target keywords included in the target keyword set;
[0058] Obtaining a character string between the i-th target keyword and the i+1-th target keyword as the i-th target keyword value corresponding to the i-th target keyword;
[0059] Combining the i-th target keyword with the i-th target keyword value to obtain the i-th sub-sample;
[0060] Increment i by 1 to update the value of i;
[0061] If it is determined that i is less than N, return to the step of obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set;
[0062] If it is determined that i is equal to N, obtaining the character string following the Nth target keyword in the API document data as the Nth target keyword value corresponding to the Nth target keyword, combining the Nth target keyword and the Nth target keyword value to obtain the Nth sub-sample, and returning to the step of incrementing i by 1 to update the value of i;
[0063] If it is determined that i is greater than N, the 1st to Nth sub-samples are obtained and combined in sequence to obtain the first request body sample data.
[0064] In this embodiment, since development document data is generally edited in advance when the object to be tested is developed (it may not be uploaded to the server together with the object to be tested), and one of the sections may be an API interface document. If development document data corresponding to the object to be tested exists on the server, and an API interface document exists in the development document data, the first request body sample data can be obtained based on the API document data; wherein, generally, whether the API interface document exists in the development document data can be determined by searching for the keyword "API interface" in the section title or the secondary title of the document. If the API interface exists in the section title or the secondary title of the document, it is determined that the API interface document exists in the development document data. If the API interface does not exist in the section title or the secondary title of the document, it is determined that the API interface document does not exist in the development document data.
[0065] Among them, when obtaining the first request body sample data based on the API document data, specifically, first obtaining a preset interface request body keyword list and the interface request body keywords included in the interface request body keyword list, such as at least including the interface name, interface description, request parameters, successful return and error return keywords in the interface request body keyword list; then determining whether the above keywords exist in the API document data, if the above keywords exist in the API document data, the character string between each keyword and the next keyword is used as the keyword value of each keyword, such as the interface name, interface description, For the five keywords of request parameters, successful return, and error return, all character strings between the interface name and the interface description are used as the keyword value of the interface name, all character strings between the interface description and the request parameters are used as the keyword value of the interface description, all character strings between the request parameters and the successful return are used as the keyword value of the request parameters, all character strings between the successful return and the error return are used as the keyword value of the successful return, and all character strings from the error return to the end of the API document data are used as the keyword value of the error return; finally, each of the above keywords is combined with the corresponding keyword value and then integrated into a complete first request body sample data. It can be seen that through this method of obtaining the first request body sample data based on the API document data, the request body sample can be automatically obtained without manually checking the development document data, thereby improving the efficiency of obtaining the request body sample.
[0066] For example, in the above example, after obtaining the interface name, document description, request parameters, success return, error return, and their respective keyword values, the combined first request body sample data is as follows:
[0067] Interface name: regist1;
[0068] Interface description: registration interface;
[0069] Request parameters: username, password;
[0070] Successful return: userData;
[0071] Error return: msg (error prompt).
[0072] After obtaining the sample data of the first request body as described above, it can be used to generate the JMeter script later.
[0073] S105: Perform script conversion and generation on the first request body sample data according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a first conversion script.
[0074] In this embodiment, after obtaining the first request body sample data based on the development document data of the object to be tested, the first request body sample data is first intercepted by the first stress testing plug-in data, and then the key data of the first request body sample data is parsed (i.e., the keywords and keyword values included in the first request body sample data are obtained), and the key data obtained by the parsing is input into the plug-in corresponding to the first stress testing plug-in data for conversion processing, and a first format script can be output (for example, the first format script can be a jmx script, and the jmx script is a stress testing script dedicated to stress testing), and then the first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion processing to obtain the first conversion script. In this way, the generation of the jmx script is mainly performed automatically in the first stress testing plug-in, without the need for manual editing by the user, thereby improving the efficiency of script generation.
[0075] If the first format script is a jmx script, the jmx script is essentially an XML document with a tree structure. The first-level directory includes jmeterTestPlan (i.e., jmeter test plan), the second-level directory includes hashTree (i.e., hash tree), and the third-level directory includes TestPlan (test plan), hashTree (test plan configuration), WorkBench (workbench), and hashTree (workbench configuration). Once the first request body sample data is obtained, it needs to be filled into the specified location of the specified directory in the jmx script sample to obtain the first conversion script.
[0076] In one embodiment, step S105 includes:
[0077] Obtain the XML document template and corresponding tree structure corresponding to the first stress testing plug-in data;
[0078] Fill each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script;
[0079] The first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion to obtain a first conversion script.
[0080] In this embodiment, by automatically filling the keywords and corresponding keyword values included in the first request body sample data into the third-level directory in the tree structure in the first stress testing plug-in, the filtering and annotation functions of the first stress testing plug-in are fully utilized, so that only fine-tuning is required in the second stress testing plug-in.
[0081] In one embodiment, the step of filling each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script includes:
[0082] Fill each keyword and corresponding keyword value included in the first request body sample data into the test plan in the third-level directory to obtain a first format script.
[0083] In this embodiment, it is determined in advance that the third-level directory in the tree structure includes TestPlan (test plan), hashTree (configuration of the test plan), WorkBench (workbench), and hashTree (configuration under the workbench). Therefore, the keywords and corresponding keyword values included in the first request body sample data are filled into the test plan in the third-level directory, so that the first format script can be quickly generated and the accuracy of the generated script can be ensured.
[0084] S106: Perform a stress test on the object to be tested using the first conversion script to obtain a first stress test result.
[0085] In this embodiment, after fine-tuning the first format script in the second stress testing plug-in to obtain a first conversion script, the first conversion script is run in the second stress testing plug-in to obtain corresponding stress test results. After the stress test results are obtained on the server, they can be sent to the receiving end for viewing. This allows timely determination of whether to further optimize the test object after viewing the stress test results.
[0086]
[0087] Table 1
[0088] In one embodiment, step S106 includes:
[0089] A memory stress test is performed on the object to be tested using the first conversion script to obtain a first stress test result including concurrency, thread group increment, continuous running time, response time, success rate, CPU usage and memory usage.
[0090] Specifically, the first stress test results include metrics and their specific values, including test items, concurrency, thread group increment, continuous run time, response time, success rate, CPU utilization, and memory utilization. For example, using memory stress testing as an example, the first stress test results are shown in Table 1 above. This shows that the second stress testing plug-in can quickly run the first conversion script to perform stress testing on the test object.
[0091] In one embodiment, after step S106, the method further includes:
[0092] If it is determined that the development document data is a null value, obtaining the application type of the object to be tested, obtaining a set of similar applications based on the application type, and obtaining a historical request body of each similar application in the set of similar applications to form a historical request body set;
[0093] Performing script conversion and generation on any one historical request body in the historical request body set according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a second conversion script;
[0094] A stress test is performed on the object to be tested using the second conversion script to obtain a second stress test result.
[0095] In this embodiment, since the application type of the application can be pre-set during the application development process, when the development document data related to the application cannot be queried in the server (that is, the development document data is determined to be a null value), an application similar to the application can be obtained (for example, the application types of the two are the same and can be regarded as similar applications). At this time, the historical request body of the similar application can be used to generate a stress testing script.
[0096] Similarly, you can refer to the generation method of the first conversion script, which is to first intercept an arbitrarily selected historical request body from the historical request body set by the first stress testing plug-in data, and then parse the key data of the historical request body (that is, obtain which keywords and keyword values the historical request body includes), and input the key data obtained by the analysis into the plug-in corresponding to the first stress testing plug-in data for conversion processing. Another first format script can be output (for example, another first format script can also be a jmx script), and then the other first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion processing to obtain the second conversion script.
[0097] After fine-tuning another first format script in the second stress testing plug-in to obtain a second conversion script, the second conversion script is run in the second stress testing plug-in to obtain corresponding stress testing results.
[0098] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0099] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0100] This method concentrates the main conversion generation work of the first conversion script in the plug-in corresponding to the first stress testing plug-in data. Compared with concentrating the main conversion generation work of the first conversion script in the plug-in corresponding to the second stress testing plug-in data, it not only reduces the difficulty of script generation, but also improves the generation efficiency.
[0101] The embodiment of the present invention also provides a device for generating a stress test script based on automatic packet capture, which is used to execute any embodiment of the aforementioned method for generating a stress test script based on automatic packet capture. Figure 3 , Figure 3 4 is a schematic block diagram of a stress testing script generation device 100 based on automatic packet capture provided in an embodiment of the present invention.
[0102] Among them, such as Figure 3 As shown, the stress testing script generation device 100 based on automatic packet capture includes a test object acquisition unit 101, a first configuration unit 102, a second configuration unit 103, a first sample data acquisition unit 104, a first script generation unit 105 and a first testing unit 106.
[0103] The object to be tested acquiring unit 101 is configured to respond to a stress testing instruction and acquire an object to be tested corresponding to the stress testing instruction.
[0104] In the present embodiment, the technical solution is described with the server as the execution subject. When the development of a certain object (such as application software, more specifically the API interface of the application software) is completed, it needs to be stress tested before going online. At this time, the object to be tested is deployed in the server. Generally, stress testing refers to running a test on an application program under the conditions of a small number of computers or a lack of system resources. The resources usually required for software stress testing include internal memory, CPU availability, disk space and network bandwidth. For example, when a large number of users access the server in a short period of time to use the services provided by the above-mentioned object to be tested are simulated, stress testing can be performed on it. In order to simulate the effect of a large number of users accessing the server in a short period of time, JMeter scripts can be used to implement it. If the JMeter script method of manual writing is directly adopted (such as manual writing with reference to API documents), not only the professional requirements of the script writer are very high, but also the writing efficiency is low. In this application, the method of automatically generating JMeter scripts can be used to improve the generation efficiency of JMeter scripts, thereby further improving the efficiency of stress testing.
[0105] The first configuration unit 102 is configured to obtain first plug-in data, and perform plug-in configuration according to the first plug-in data to obtain first stress testing plug-in data.
[0106] In the present embodiment, the first plug-in data corresponds to a Fiddler plug-in, which is an http protocol debugging proxy tool that can record and check http communications between all terminals and the Internet, set breakpoints, and view all data entering and leaving Fiddler (referring to files such as cookies, html, js, and css). When using the Fiddler plug-in corresponding to the first plug-in data, it is necessary to first configure it and deploy it to the server, and then the Fiddler plug-in can participate in the pressure testing process. In this application, in order to realize automatic generation of JMeter scripts, the first pressure testing plug-in data can share more script generation work, and before using the plug-in function corresponding to the first pressure testing plug-in data, it needs to be initially configured and can be used.
[0107] In one embodiment, the first configuration unit 102 is specifically configured to:
[0108] Initialize and create a class library project;
[0109] Add a reference to the first plug-in data to obtain a first update class library project;
[0110] Adding preset attribute information to the assembly information in the first updated class library project to obtain a second updated class library project;
[0111] Creating at least one new class in the second updated class library project to inherit the interface exposed in the second updated class library project, to obtain a third updated class library project;
[0112] Compiling the third update class library project to obtain a first dynamic link library file, and copying the first dynamic link library file to a pre-created empty script to obtain a first script;
[0113] The plug-in configuration is performed according to the first script to obtain first stress testing plug-in data.
[0114] In this embodiment, when the plug-in function corresponding to the first stress testing plug-in data is used for initial configuration, the following process is specifically performed:
[0115] 1) Initialize and create a class library project (such as a Visual C# Class Library project);
[0116] 2) Add a reference to the first plug-in data in the Solution Explorer of the class library project (i.e., add a reference to fiddler.exe);
[0117] 3) Adding preset attribute information to the assembly information in the first updated class library project (such as the assembly information can be viewed in the AssemblyInfo.cs file) to obtain a second updated class library project; wherein the preset attribute information is [assembly:Fiddler.RequiredVersion("4.6.2.0")];
[0118] 4) creating at least one new class in the second updated class library project, so as to inherit the interface exposed in the second updated class library project through the new class, thereby obtaining a third updated class library project;
[0119] 5) Compile the third update class library project to obtain a first dynamic link library file (the first dynamic link library file can also be abbreviated as a first DLL file), and then copy the first dynamic link library file to a pre-created empty script (such as Scripts) to obtain a first script. The above copying process is performed because the DLL file needs to be placed in ImportExport when batch import and export operations are performed on requests.
[0120] After completing the above configuration process of the first plug-in data, a plug-in capable of recording and checking the request body of HTTP communication is embedded in the server.
[0121] The second configuration unit 103 is configured to obtain second plug-in data, and perform plug-in configuration according to the second plug-in data to obtain second stress testing plug-in data.
[0122] In this embodiment, the second plug-in data corresponds to a JMeter plug-in, which can be used to test static and dynamic resources such as static files, Java servlets, CGI scripts, Java objects, databases, FTP servers, etc. JMeter can be used to simulate heavy loads on servers, networks, or objects to test their strength and analyze overall performance under different stress categories. Additionally, JMeter can perform functional / regression testing on applications by creating scripts with assertions to verify that your program returns expected results. The primary work of generating JMeter scripts on the server is shifted to the Fiddler plug-in, effectively avoiding the increased operational difficulty and reduced testing efficiency caused by the JMeter plug-in operating in non-GUI mode for high-concurrency testing. Furthermore, in high-concurrency testing, since the JMeter command line is only effective for a single concurrency level, generating test reports for high-concurrency tests requires multiple scripts. The first stress testing plug-in data, however, offloads more of the script generation work, eliminating the need to develop multiple scripts to generate test reports for high-concurrency tests.
[0123] The first sample data acquisition unit 104 is used to obtain the development document data if it is determined that the development document data of the object to be tested is not a null value, extract keywords and keyword values from the API document data in the development document data, and form the first request body sample data with the keywords and keyword values.
[0124] In the present embodiment, in order to generate JMeter scripts more accurately, it is still necessary to refer to the API document data in the development document data of the object to be tested. Generally, the development document data will include functional requirements, bidding plans, demand analysis, technical analysis, system analysis, database documents, functional function documents, interface documents, compilation manuals, QA documents (i.e., question and answer documents) and project summaries, and will also generally include API interface documents (which can be understood as API document data). In order to more quickly analyze the request body format corresponding to the API interface of the object to be tested based on the API document data, it is necessary to perform keyword extraction on the API document data in the development document data to obtain a script keyword set, and form candidate keywords of the request body format corresponding to the API interface with each script keyword included in the script keyword set.
[0125] In one embodiment, the first sample data acquisition unit 104 is specifically configured to:
[0126] Obtaining a pre-stored interface request body keyword list and the interface request body keywords included in the interface request body keyword list, searching for target keywords having any interface request body keyword in the API document data, and forming a target keyword set;
[0127] Obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set; wherein the initial value of i is 1 and the value range of i is [1, N], where N is the total number of target keywords included in the target keyword set;
[0128] Obtaining a character string between the i-th target keyword and the i+1-th target keyword as the i-th target keyword value corresponding to the i-th target keyword;
[0129] Combining the i-th target keyword with the i-th target keyword value to obtain the i-th sub-sample;
[0130] Increment i by 1 to update the value of i;
[0131] If it is determined that i is less than N, return to the step of obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set;
[0132] If it is determined that i is equal to N, obtaining the character string following the Nth target keyword in the API document data as the Nth target keyword value corresponding to the Nth target keyword, combining the Nth target keyword and the Nth target keyword value to obtain the Nth sub-sample, and returning to the step of incrementing i by 1 to update the value of i;
[0133] If it is determined that i is greater than N, the 1st to Nth sub-samples are obtained and combined in sequence to obtain the first request body sample data.
[0134] In this embodiment, since development document data is generally edited in advance when the object to be tested is developed (it may not be uploaded to the server together with the object to be tested), and one of the sections may be an API interface document. If development document data corresponding to the object to be tested exists on the server, and an API interface document exists in the development document data, the first request body sample data can be obtained based on the API document data; wherein, generally, whether the API interface document exists in the development document data can be determined by searching for the keyword "API interface" in the section title or the secondary title of the document. If the API interface exists in the section title or the secondary title of the document, it is determined that the API interface document exists in the development document data. If the API interface does not exist in the section title or the secondary title of the document, it is determined that the API interface document does not exist in the development document data.
[0135] Among them, when obtaining the first request body sample data based on the API document data, specifically, first obtaining a preset interface request body keyword list and the interface request body keywords included in the interface request body keyword list, such as at least including the interface name, interface description, request parameters, successful return and error return keywords in the interface request body keyword list; then determining whether the above keywords exist in the API document data, if the above keywords exist in the API document data, the character string between each keyword and the next keyword is used as the keyword value of each keyword, such as the interface name, interface description, For the five keywords of request parameters, successful return, and error return, all character strings between the interface name and the interface description are used as the keyword value of the interface name, all character strings between the interface description and the request parameters are used as the keyword value of the interface description, all character strings between the request parameters and the successful return are used as the keyword value of the request parameters, all character strings between the successful return and the error return are used as the keyword value of the successful return, and all character strings from the error return to the end of the API document data are used as the keyword value of the error return; finally, each of the above keywords is combined with the corresponding keyword value and then integrated into a complete first request body sample data. It can be seen that through this method of obtaining the first request body sample data based on the API document data, the request body sample can be automatically obtained without manually checking the development document data, thereby improving the efficiency of obtaining the request body sample.
[0136] For example, in the above example, after obtaining the interface name, document description, request parameters, success return, error return, and their respective keyword values, the combined first request body sample data is as follows:
[0137] Interface name: regist1;
[0138] Interface description: registration interface;
[0139] Request parameters: username, password;
[0140] Successful return: userData;
[0141] Error return: msg (error prompt).
[0142] After obtaining the sample data of the first request body as described above, it can be used to generate the JMeter script later.
[0143] The first script generating unit 105 is configured to perform script conversion and generation on the first request body sample data according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a first conversion script.
[0144] In this embodiment, after obtaining the first request body sample data based on the development document data of the object to be tested, the first request body sample data is first intercepted by the first stress testing plug-in data, and then the key data of the first request body sample data is parsed (i.e., the keywords and keyword values included in the first request body sample data are obtained), and the key data obtained by the parsing is input into the plug-in corresponding to the first stress testing plug-in data for conversion processing, and a first format script can be output (for example, the first format script can be a jmx script, and the jmx script is a stress testing script dedicated to stress testing), and then the first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion processing to obtain the first conversion script. In this way, the generation of the jmx script is mainly performed automatically in the first stress testing plug-in, without the need for manual editing by the user, thereby improving the efficiency of script generation.
[0145] If the first format script is a jmx script, the jmx script is essentially an XML document with a tree structure. The first-level directory includes jmeterTestPlan (i.e., jmeter test plan), the second-level directory includes hashTree (i.e., hash tree), and the third-level directory includes TestPlan (test plan), hashTree (test plan configuration), WorkBench (workbench), and hashTree (workbench configuration). Once the first request body sample data is obtained, it needs to be filled into the specified location of the specified directory in the jmx script sample to obtain the first conversion script.
[0146] In one embodiment, the first script generating unit 105 is specifically configured to:
[0147] Obtain the XML document template and corresponding tree structure corresponding to the first stress testing plug-in data;
[0148] Fill each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script;
[0149] The first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion to obtain a first conversion script.
[0150] In this embodiment, by automatically filling the keywords and corresponding keyword values included in the first request body sample data into the third-level directory in the tree structure in the first stress testing plug-in, the filtering and annotation functions of the first stress testing plug-in are fully utilized, so that only fine-tuning is required in the second stress testing plug-in.
[0151] In one embodiment, the step of filling each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script includes:
[0152] Fill each keyword and corresponding keyword value included in the first request body sample data into the test plan in the third-level directory to obtain a first format script.
[0153] In this embodiment, it is determined in advance that the third-level directory in the tree structure includes TestPlan (test plan), hashTree (configuration of the test plan), WorkBench (workbench), and hashTree (configuration under the workbench). Therefore, the keywords and corresponding keyword values included in the first request body sample data are filled into the test plan in the third-level directory, so that the first format script can be quickly generated and the accuracy of the generated script can be ensured.
[0154] The first testing unit 106 is configured to perform a stress test on the object to be tested using the first conversion script to obtain a first stress test result.
[0155] In this embodiment, after fine-tuning the first format script in the second stress testing plug-in to obtain a first conversion script, the first conversion script is run in the second stress testing plug-in to obtain corresponding stress test results. After the stress test results are obtained on the server, they can be sent to the receiving end for viewing. This allows timely determination of whether to further optimize the test object after viewing the stress test results.
[0156] In one embodiment, step S106 includes:
[0157] A memory stress test is performed on the object to be tested using the first conversion script to obtain a first stress test result including concurrency, thread group increment, continuous running time, response time, success rate, CPU usage and memory usage.
[0158] Specifically, the first stress test results include metrics and their specific values, including test items, concurrency, thread group increment, continuous run time, response time, success rate, CPU utilization, and memory utilization. For example, using memory stress testing as an example, the first stress test results are shown in Table 1 above. This shows that the second stress testing plug-in can quickly run the first conversion script to perform stress testing on the test object.
[0159] In one embodiment, the stress testing script generation device 100 based on automatic packet capture further includes:
[0160] a historical request body set acquisition unit, configured to, if it is determined that the development document data is a null value, acquire the application type of the object to be tested, acquire a set of similar applications based on the application type, and acquire the historical request body of each similar application in the set of similar applications to form a historical request body set;
[0161] a second script generating unit, configured to convert and generate a script for any one historical request body in the historical request body set according to the first stress testing plug-in data and the second stress testing plug-in data in sequence, to obtain a second converted script;
[0162] The second testing unit is configured to perform a stress test on the object to be tested using the second conversion script to obtain a second stress test result.
[0163] In this embodiment, since the application type of the application can be pre-set during the application development process, when the development document data related to the application cannot be queried in the server (that is, the development document data is determined to be a null value), an application similar to the application can be obtained (for example, the application types of the two are the same and can be regarded as similar applications). At this time, the historical request body of the similar application can be used to generate a stress testing script.
[0164] Similarly, you can refer to the generation method of the first conversion script, which is to first intercept an arbitrarily selected historical request body from the historical request body set by the first stress testing plug-in data, and then parse the key data of the historical request body (that is, obtain which keywords and keyword values the historical request body includes), and input the key data obtained by the analysis into the plug-in corresponding to the first stress testing plug-in data for conversion processing. Another first format script can be output (for example, another first format script can also be a jmx script), and then the other first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion processing to obtain the second conversion script.
[0165] After fine-tuning another first format script in the second stress testing plug-in to obtain a second conversion script, the second conversion script is run in the second stress testing plug-in to obtain corresponding stress testing results.
[0166] The device realizes concentrating the main conversion generation work of the first conversion script in the plug-in corresponding to the first stress testing plug-in data. Compared with concentrating the main conversion generation work of the first conversion script in the plug-in corresponding to the second stress testing plug-in data, it not only reduces the difficulty of script generation, but also improves the generation efficiency.
[0167] The above-mentioned stress test script generation device based on automatic packet capture can be implemented in the form of a computer program. The computer program can be used in Figure 4Runs on the computer device shown.
[0168] See also Figure 4 , Figure 4 1 is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device 500 is a server or a server cluster. The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0169] See Figure 4 The computer device 500 includes a processor 502 , a memory, and a network interface 505 connected via a device bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .
[0170] The storage medium 503 can store an operating device 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a stress testing script generation method based on automatic packet capture.
[0171] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0172] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the stress testing script generation method based on automatic packet capture.
[0173] The network interface 505 is used for network communication, such as providing data information transmission. Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0174] The processor 502 is configured to run a computer program 5032 stored in a memory to implement the method for generating a stress testing script based on automatic packet capture disclosed in an embodiment of the present invention.
[0175] Those skilled in the art will understand that Figure 4The embodiment of the computer device shown in the figure does not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structure and function of the memory and processor are the same as those in the figure. Figure 4 The embodiments shown are consistent and will not be described again here.
[0176] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0177] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the method for generating a stress testing script based on automatic packet capture disclosed in an embodiment of the present invention is implemented.
[0178] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0179] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, or units with the same function may be combined into one unit. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0180] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
[0181] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a backend server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0183] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A method for generating a stress testing script based on automatic packet capture, characterized in that: include: In response to a stress testing instruction, obtaining an object to be tested corresponding to the stress testing instruction; Obtain first plug-in data, and configure the plug-in according to the first plug-in data to obtain first stress testing plug-in data; Obtain second plug-in data, and configure the plug-in according to the second plug-in data to obtain second stress testing plug-in data; If it is determined that the development document data of the object to be tested is not a null value, the development document data is obtained, keywords and keyword values are extracted from the API document data in the development document data, and the keywords and keyword values are used to form a first request body sample data; Convert and generate scripts on the first request body sample data according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a first conversion script; as well as Performing a stress test on the object to be tested using the first conversion script to obtain a first stress test result; The first plug-in data corresponds to the Fiddler plug-in, and the second plug-in data corresponds to the JMeter plug-in; The obtaining of first plug-in data and performing plug-in configuration according to the first plug-in data to obtain first stress testing plug-in data includes: Initialize and create a class library project; Add a reference to the first plug-in data to obtain a first update class library project; Adding preset attribute information to the assembly information in the first updated class library project to obtain a second updated class library project; Creating at least one new class in the second updated class library project to inherit the interface exposed in the second updated class library project, to obtain a third updated class library project; Compiling the third update class library project to obtain a first dynamic link library file, and copying the first dynamic link library file to a pre-created empty script to obtain a first script; The plug-in configuration is performed according to the first script to obtain first stress testing plug-in data.
2. The method for generating a stress testing script based on automatic packet capture according to claim 1, characterized in that: Also includes: If it is determined that the development document data is a null value, obtaining the application type of the object to be tested, obtaining a set of similar applications based on the application type, and obtaining a historical request body of each similar application in the set of similar applications to form a historical request body set; Performing script conversion and generation on any one historical request body in the historical request body set according to the first stress testing plug-in data and the second stress testing plug-in data in sequence to obtain a second conversion script; A stress test is performed on the object to be tested using the second conversion script to obtain a second stress test result.
3. The method for generating a stress testing script based on automatic packet capture according to claim 1, wherein: The acquiring of the development document data, extracting keywords and keyword values from the API document data in the development document data, and forming first request body sample data from the keywords and keyword values include: Obtaining a pre-stored interface request body keyword list and the interface request body keywords included in the interface request body keyword list, and obtaining target keywords having any interface request body keyword in the API document data to form a target keyword set; Obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set; wherein the initial value of i is 1 and the value range of i is [1, N], where N is the total number of target keywords included in the target keyword set; Obtaining a character string between the i-th target keyword and the i+1-th target keyword as the i-th target keyword value corresponding to the i-th target keyword; Combining the i-th target keyword with the i-th target keyword value to obtain the i-th sub-sample; Increment i by 1 to update the value of i; If it is determined that i is less than N, return to the step of obtaining the i-th target keyword and the i+1-th target keyword in the target keyword set; If it is determined that i is equal to N, obtaining the character string following the Nth target keyword in the API document data as the Nth target keyword value corresponding to the Nth target keyword, combining the Nth target keyword and the Nth target keyword value to obtain the Nth sub-sample, and returning to the step of incrementing i by 1 to update the value of i; If it is determined that i is greater than N, the 1st to Nth sub-samples are obtained and combined in sequence to obtain the first request body sample data.
4. The method for generating a stress testing script based on automatic packet capture according to claim 1, wherein: The step of converting and generating a script based on the first stress testing plug-in data and the second stress testing plug-in data to obtain a first conversion script includes: Obtain the XML document template and corresponding tree structure corresponding to the first stress testing plug-in data; Fill each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script; The first format script is input into the plug-in corresponding to the second stress testing plug-in data for conversion to obtain a first conversion script.
5. The method for generating a stress testing script based on automatic packet capture according to claim 4, characterized in that: The step of filling each keyword and corresponding keyword value included in the first request body sample data into the third-level directory in the tree structure to obtain a first format script includes: Fill each keyword and corresponding keyword value included in the first request body sample data into the test plan in the third-level directory to obtain a first format script.
6. The method for generating a stress testing script based on automatic packet capture according to claim 1, wherein: The step of performing a stress test on the object to be tested by using the first conversion script to obtain a first stress test result includes: A memory stress test is performed on the object to be tested using the first conversion script to obtain a first stress test result including concurrency, thread group increment, continuous running time, response time, success rate, CPU usage and memory usage.
7. A stress test script generation device based on automatic packet capture, characterized in that: include: A test object acquisition unit, configured to respond to a stress testing instruction and acquire a test object corresponding to the stress testing instruction; A first configuration unit is configured to obtain first plug-in data, and configure the plug-in according to the first plug-in data to obtain first stress testing plug-in data; A second configuration unit is configured to obtain second plug-in data, and configure the plug-in according to the second plug-in data to obtain second stress testing plug-in data; A first sample data acquisition unit is configured to, if it is determined that the development document data of the object to be tested is not null, acquire the development document data, extract keywords and keyword values from API document data in the development document data, and form first request body sample data from the keywords and keyword values; a first script generating unit, configured to convert and generate a script based on the first request body sample data in sequence according to the first stress testing plug-in data and the second stress testing plug-in data, to obtain a first conversion script; as well as A first testing unit, configured to perform a stress test on the object to be tested using the first conversion script to obtain a first stress test result; The first plug-in data corresponds to the Fiddler plug-in, and the second plug-in data corresponds to the JMeter plug-in; The first configuration unit is specifically configured to: Initialize and create a class library project; Add a reference to the first plug-in data to obtain a first update class library project; Adding preset attribute information to the assembly information in the first updated class library project to obtain a second updated class library project; Creating at least one new class in the second updated class library project to inherit the interface exposed in the second updated class library project, to obtain a third updated class library project; Compiling the third update class library project to obtain a first dynamic link library file, and copying the first dynamic link library file to a pre-created empty script to obtain a first script; The plug-in configuration is performed according to the first script to obtain first stress testing plug-in data.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for generating a stress testing script based on automatic packet capture according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to execute the method for generating a stress testing script based on automatic packet capture according to any one of claims 1 to 6.
Citation Information
Patent Citations
Python-based performance test method and device,, computer equipment and storage medium
CN111444111A
Method for generating interface test script and related equipment thereof
CN112286815A