A log-based testing method, device and computer system
Through log-based testing methods, automated configuration and verification, the tedious problems of manual writing and verification in traditional testing environments are solved, and testing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202011448356.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In the traditional web-side testing environment, you need to manually write test cases and manually modify parameters before testing, which is time-consuming, cumbersome and error-prone. After testing, the running results of each case need to be verified, which is prone to omissions and errors.
Provide a log-based testing method, by obtaining the target test case, configuring the object to be tested as a test scenario, generating and sending test HTTP requests, generating request logs, and verifying the logs based on verification parameters to determine whether there are exceptions in the test scenario. Monitor and distribute requests in real time to avoid manual repeated configuration and verification.
Automated testing is realized, reducing the duplication of manual configuration and verification, improving testing efficiency, avoiding omissions and errors, and simplifying the testing process.
Smart Images

Figure CN112905445B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing, and in particular to a log-based testing method, device and computer system. Background Art
[0002] In order to ensure the normal use of computer programs, software developers need to test computer programs frequently. In the traditional web-based testing environment, it is necessary to manually write the corresponding test cases before each test and manually modify the corresponding parameters during the test, which is time-consuming, cumbersome, and prone to errors. After the web-based end generates the corresponding request log, it is also necessary to verify the running results of each test case separately, which is prone to omissions and errors. Summary of the invention
[0003] In order to solve the deficiencies of the prior art, the main purpose of the present invention is to provide a log-based testing method, device and computer system to solve the above-mentioned problems of the prior art.
[0004] In order to achieve the above object, the present invention provides a log-based testing method in a first aspect, the method comprising:
[0005] Obtain a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested;
[0006] Configuring the object to be tested as a test scenario corresponding to the target test case;
[0007] Generate and send a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations;
[0008] The request log is verified according to the corresponding verification parameters and it is determined whether there is an abnormality in the test scenario according to the verification result.
[0009] In some embodiments, the preset test parameters include a corresponding scenario ID, and the generating and sending of a test Http request according to the preset test parameters corresponding to the test scenario so that the test scenario receives the test Http request and generates a corresponding request log after processing includes:
[0010] Monitor the object to be tested in real time. When it is monitored that the object to be tested receives a test http request, assign the received test Http request to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
[0011] In some embodiments, the test scenario receives the test Http request and generates a corresponding request log after processing, including:
[0012] Publishing the generated request log to a preset proxy object;
[0013] Verifying the request log according to the corresponding verification parameter and determining whether the test scenario is abnormal according to the verification result includes:
[0014] Subscribe to the request log corresponding to the scenario ID, so as to obtain the published request log from the preset proxy object and verify the request log according to the verification parameters corresponding to the test scenario.
[0015] In some embodiments, the preset test parameters include a corresponding test access browser.
[0016] In some embodiments, the request log includes generated fields and target parameters corresponding to each field, and verifying the request log according to the corresponding verification parameters and determining whether the test scenario is abnormal according to the verification result includes:
[0017] When the target parameter corresponding to each field is the same as the verification parameter corresponding to the field, it is determined that there is no abnormality in the test scenario.
[0018] In some embodiments, the method comprises:
[0019] When the target parameter corresponding to a field is different from the corresponding verification parameter, an alarm signal is issued, and the alarm signal includes the target parameter different from the corresponding verification parameter and the corresponding field.
[0020] In a second aspect, the present application provides a log-based testing device, the device comprising:
[0021] An acquisition module, used to acquire a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested;
[0022] A configuration module, used to configure the object to be tested into a test scenario corresponding to the target test case;
[0023] A generation module, used to generate and send a test Http request according to preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, wherein the test Http request is used to simulate user operations;
[0024] The verification module is used to verify the request log according to the corresponding verification parameters and determine whether there is an abnormality in the test scenario according to the verification result.
[0025] In some embodiments, the preset test parameters include a corresponding scenario ID, and the generation module can also be used to monitor the object to be tested in real time. When the object to be tested is monitored to receive a test http request, the received test Http request is assigned to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
[0026] In some embodiments, the test scenario publishes the generated request log to a preset proxy object, and the verification module can also be used to subscribe to the request log corresponding to the scenario ID so as to obtain the published request log from the preset proxy object and verify the request log according to the verification parameters corresponding to the test scenario.
[0027] In a third aspect, the present application provides a computer system, the system comprising:
[0028] one or more processors;
[0029] and a memory associated with the one or more processors, the memory being used to store program instructions, the program instructions when read and executed by the one or more processors performing the following operations:
[0030] Obtain a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested;
[0031] Configuring the object to be tested as a test scenario corresponding to the target test case;
[0032] Generate and send a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations;
[0033] The request log is verified according to the corresponding verification parameters and it is determined whether there is an abnormality in the test scenario according to the verification result.
[0034] The beneficial effects achieved by the present invention are:
[0035] The present application provides a log-based testing method, comprising obtaining a target test case, wherein the target test case comprises at least one test scenario, corresponding verification parameters and preset test parameters, wherein the target test case is used to test a corresponding object to be tested; configuring the object to be tested as a test scenario corresponding to the target test case; generating and sending a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, wherein the test Http request is used to simulate user operations; verifying the request log according to the corresponding verification parameters and determining whether the test scenario has an abnormality according to the verification result, wherein a tester may pre-write a test case for each object to be tested, determine a test scenario, verification parameters and test parameters for each test case, and during testing, directly configure the object to be tested as a corresponding test scenario according to the test case, and generate a test request according to the preset test parameters, thereby avoiding manual configuration of the object to be tested multiple times and repeated simulation of requests for simulating user operations, and when the request log is obtained by the test, the request log may be directly verified according to the corresponding verification parameters, thereby avoiding the problem of easy omissions caused by manual verification after all tests are completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 It is a log-based test flow chart provided in an embodiment of the present application;
[0038] Figure 2 is a flow chart of the method provided in the embodiment of the present application;
[0039] Figure 3 is a structural diagram of a device provided in an embodiment of the present application;
[0040] Figure 4 It is a computer system structure diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0042] Embodiment 1
[0043] To solve the problems described in the background technology, the present application provides a log-based testing method. The test case described in the present application includes a corresponding object to be tested, a test scenario, verification parameters corresponding to each test scenario, and preset test parameters. The object to be tested can be any web-based server. The test scenario includes the object to be tested, including Pageid, pagename, and other parameters for matching the corresponding object to be tested, and the corresponding scenario ID, trigger type, and trigger object. The trigger type includes a trigger scenario corresponding to a test HTTP request, such as a test HTTP request generated after a user clicks on a certain page element or after a user browses the object to be tested, etc. The trigger object includes a configuration value corresponding to the element to be tested, and the element to be tested can be configured to a state to be tested according to the configuration value, and the element to be tested includes an HTML page element, etc. The verification parameter includes a preset correct result corresponding to the field included in the request log obtained after the test scenario processes the corresponding request.
[0044] In order to implement automated testing, the test environment needs to be set up in advance. The process includes:
[0045] S1. Initialize the test environment and create an Http request proxy object;
[0046] Each of the Http request proxy objects records the scenario ID that each callback function pre-subscribes to, i.e., monitors. The HTTP request proxy object monitors the request log generated by the object to be tested. After monitoring the generated request log, the request log is passed to the callback function that monitors the scenario ID according to the scenario ID corresponding to the request log. When the callback function obtains the request log, it will first determine whether it is a request log generated by the test scenario monitored by the callback function according to the scenario ID corresponding to the request log. If it is determined to be, it will check whether there is an exception according to the verification parameters.
[0047] S2, generate proxy Http request;
[0048] The proxy HTTP request is used to send the generated test Http request simulating user behavior to the corresponding test scenario.
[0049] When the test environment is built, Figure 1 As shown, the log-based testing method disclosed in this application specifically includes:
[0050] Step 1: Obtain the target test case;
[0051] Before testing, testers can pre-write test cases and set the corresponding tracking points for each scenario. The target test case includes the corresponding object to be tested, test scenario, and the corresponding verification parameters and preset verification parameters for each test scenario.
[0052] Step 2: Configure the object to be tested as the corresponding test scenario;
[0053] Each object to be tested may have multiple corresponding test scenarios, and each test scenario may be tested sequentially or simultaneously, which is not limited in this application.
[0054] When configuring, you can also set the callback function corresponding to the test scenario and subscribe to the request log corresponding to the scenario ID in the Http request proxy object.
[0055] Step 3: Generate a test HTTP request according to the preset test parameters corresponding to the test scenario and send it to the object to be tested, and the proxy Http request receives and forwards it to the corresponding test scenario;
[0056] The test HTTP request is used to simulate the user's operation on the test object. The preset test parameters can specify the corresponding access browser, that is, the browser used by the user corresponding to the test request when generating the Http request.
[0057] Step 4: Generate the corresponding request log after the test scenario is processed;
[0058] When a test scenario generates a request log, the corresponding scenario ID is written in the request log.
[0059] Step 5: When the Http request proxy object monitors the request log, it distributes the test log to the corresponding callback function according to the scenario ID;
[0060] Step 6: Obtain the corresponding request log through the callback function and verify it. When the target parameter corresponding to each field in the request log is the same as the preset verification parameter, it is determined that there is no abnormality in the request log and the corresponding test scenario.
[0061] When there is a difference, it is determined that the corresponding test scenario is abnormal and an alarm signal is sent. The alarm signal includes a target parameter that is different from the preset verification parameter and a field corresponding to the target parameter.
[0062] Embodiment 2
[0063] Corresponding to the above embodiment, Figure 2As shown, the present application provides a log-based testing method, the method comprising:
[0064] 210. Obtain a target test case, where the target test case includes at least one test scenario, corresponding verification parameters, and preset test parameters, and the target test case is used to test a corresponding object to be tested;
[0065] 220. Configuring the object to be tested as a test scenario corresponding to the target test case;
[0066] 230. Generate and send a test Http request according to preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, wherein the test Http request is used to simulate user operations;
[0067] Preferably, the preset test parameters include a corresponding scenario ID, and the generating and sending of a test Http request according to the preset test parameters corresponding to the test scenario so that the test scenario receives the test Http request and generates a corresponding request log after processing includes:
[0068] 231. Monitor the object to be tested in real time. When it is monitored that the object to be tested receives a test http request, assign the received test Http request to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
[0069] 240. Verify the request log according to the corresponding verification parameter and determine whether there is an abnormality in the test scenario according to the verification result.
[0070] Preferably, the test scenario receives the test Http request and generates a corresponding request log after processing, including:
[0071] 241. Publishing the generated request log to a preset proxy object;
[0072] Verifying the request log according to the corresponding verification parameter and determining whether the test scenario is abnormal according to the verification result includes:
[0073] 242. Subscribe to the request log corresponding to the scenario ID to obtain the published request log from the preset proxy object, and verify the request log according to the verification parameters corresponding to the test scenario.
[0074] Preferably, the preset test parameters include a corresponding test access browser.
[0075] Preferably, the request log includes generated fields and target parameters corresponding to each field, and verifying the request log according to the corresponding verification parameters and determining whether the test scenario is abnormal according to the verification result includes:
[0076] 243. When the target parameter corresponding to each field is the same as the verification parameter corresponding to the field, determine that there is no abnormality in the request log.
[0077] Preferably, the method comprises:
[0078] 244. When the target parameter corresponding to a field is different from the corresponding verification parameter, an alarm signal is issued, and the alarm signal includes the target parameter different from the corresponding verification parameter and the corresponding field.
[0079] Embodiment 3
[0080] Corresponding to the above method, the present application provides a log-based testing device, such as Figure 3 As shown, the device comprises:
[0081] An acquisition module 310 is configured to acquire a target test case and the request log, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested;
[0082] Configuration module 320, configured to configure the object to be tested as a test scenario corresponding to the target test case;
[0083] A generating module 330 is used to generate and send a test Http request according to preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations;
[0084] The verification module 340 is used to verify the request log according to the corresponding verification parameters and determine whether there is an abnormality in the test scenario according to the verification result.
[0085] Preferably, the preset test parameters include a corresponding scenario ID, and the generation module 330 can also be used to monitor the object to be tested in real time. When it is monitored that the object to be tested receives a test http request, the received test Http request is assigned to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
[0086] Preferably, the test scenario publishes the generated request log to a preset proxy object, and the verification module 340 can also be used to subscribe to the request log corresponding to the scenario ID, so as to obtain the published request log from the preset proxy object and verify the request log according to the verification parameters corresponding to the test scenario.
[0087] Preferably, the request log includes generated fields and target parameters corresponding to each field, and the verification module 340 can also be used to determine that there is no abnormality in the test scenario when the target parameter corresponding to each field is the same as the verification parameter corresponding to the field.
[0088] Preferably, the verification module 340 may also be used to issue an alarm signal when the target parameter corresponding to a field is different from the corresponding verification parameter, wherein the alarm signal includes the target parameter different from the corresponding verification parameter and the corresponding field.
[0089] Embodiment 4
[0090] Corresponding to the above methods, devices and systems, a fourth embodiment of the present application provides a computer system, including: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, and the program instructions, when read and executed by the one or more processors, perform the following operations:
[0091] Obtain a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested;
[0092] Configuring the object to be tested as a test scenario corresponding to the target test case;
[0093] Generate and send a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations;
[0094] The request log is verified according to the corresponding verification parameters and it is determined whether there is an abnormality in the test scenario according to the verification result.
[0095] in, Figure 4The computer system architecture is shown as an example, which may include a processor 1510, a video display adapter 1511, a disk drive 1512, an input / output interface 1513, a network interface 1514, and a memory 1520. The processor 1510, the video display adapter 1511, the disk drive 1512, the input / output interface 1513, the network interface 1514, and the memory 1520 may be communicatively connected via a communication bus 1530.
[0096] Among them, the processor 1510 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.
[0097] The memory 1520 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1520 can store an operating system 1521 for controlling the operation of the computer system 1500, and a basic input and output system (BIOS) 1522 for controlling the low-level operation of the computer system 1500. In addition, a web browser 1523, a data storage manager 1524, and an icon font processing system 1525, etc. can also be stored. The above-mentioned icon font processing system 1525 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 1520 and is called and executed by the processor 1510. The input / output interface 1513 is used to connect the input / output module to realize information input and output. The input / output / module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
[0098] The network interface 1514 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0099] The bus 1530 comprises a pathway for transmitting information between the various components of the device (eg, the processor 1510, the video display adapter 1511, the disk drive 1512, the input / output interface 1513, the network interface 1514, and the memory 1520).
[0100] In addition, the computer system 1500 can also obtain information on specific collection conditions from the virtual resource object collection condition information database 1541 for use in condition judgment, etc.
[0101] It should be noted that, although the above device only shows a processor 1510, a video display adapter 1511, a disk drive 1512, an input / output interface 1513, a network interface 1514, a memory 1520, a bus 1530, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.
[0102] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0103] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A log-based testing method, characterized in that: The method comprises: Obtain a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested; Configuring the object to be tested as a test scenario corresponding to the target test case; Generate and send a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations; Verify the request log according to the corresponding verification parameters and determine whether the test scenario is abnormal according to the verification result; Wherein, before obtaining the target test case, the method further includes: S1. Initialize the test environment and create an Http request proxy object, wherein each Http request proxy object records the scenario ID that each callback function pre-subscribes to, i.e., monitors. After monitoring the request log generated by the object to be tested, the HTTP request proxy object passes the request log to the callback function that monitors the scenario ID according to the scenario ID corresponding to the request log. The callback function determines whether the request log is generated by the test scenario monitored by the callback function according to the scenario ID corresponding to the request log. If it is determined to be, it verifies whether there is an exception according to the verification parameters. S2. Generate a proxy HTTP request, wherein the proxy HTTP request is used to send the generated test HTTP request simulating user behavior to the corresponding test scenario.
2. The method according to claim 1, characterized in that The preset test parameters include a corresponding scenario ID, and the generating and sending of a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, includes: Monitor the object to be tested in real time. When it is monitored that the object to be tested receives a test http request, assign the received test Http request to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
3. The method according to claim 2, characterized in that The test scenario receives the test Http request and generates a corresponding request log after processing, including: Publishing the generated request log to a preset proxy object; Verifying the request log according to the corresponding verification parameter and determining whether the test scenario is abnormal according to the verification result includes: Subscribe to the request log corresponding to the scenario ID, so as to obtain the published request log from the preset proxy object and verify the request log according to the verification parameters corresponding to the test scenario.
4. The method according to any one of claims 1 to 3, characterized in that: The preset test parameters include a corresponding test access browser.
5. The method according to any one of claims 1 to 3, characterized in that: The request log includes generated fields and target parameters corresponding to each field, and verifying the request log according to the corresponding verification parameters and determining whether the test scenario has an abnormality according to the verification result includes: When the target parameter corresponding to each field is the same as the verification parameter corresponding to the field, it is determined that there is no abnormality in the test scenario.
6. The method according to claim 5, characterized in that The method comprises: When the target parameter corresponding to a field is different from the corresponding verification parameter, an alarm signal is issued, and the alarm signal includes the target parameter different from the corresponding verification parameter and the corresponding field.
7. A log-based testing device for implementing the method of claim 1, characterized in that: The device comprises: An acquisition module, used to acquire a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested; A configuration module, used to configure the object to be tested into a test scenario corresponding to the target test case; A generation module, used to generate and send a test Http request according to preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, wherein the test Http request is used to simulate user operations; The verification module is used to verify the request log according to the corresponding verification parameters and determine whether there is an abnormality in the test scenario according to the verification result.
8. The device according to claim 7, characterized in that The preset test parameters include a corresponding scenario ID. The generation module can also be used to monitor the object to be tested in real time. When it is monitored that the object to be tested receives a test http request, the received test Http request is assigned to the corresponding test scenario according to the scenario ID included in the received test http request, so that the test scenario receives the test Http request and generates a corresponding request log after processing.
9. The device according to claim 8, characterized in that The test scenario publishes the generated request log to a preset proxy object, and the verification module can also be used to subscribe to the request log corresponding to the scenario ID, so as to obtain the published request log from the preset proxy object and verify the request log according to the verification parameters corresponding to the test scenario.
10. A computer system, characterized in that: The system comprises: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, the program instructions when read and executed by the one or more processors performing the following operations: Obtain a target test case, wherein the target test case includes at least one test scenario, corresponding verification parameters and preset test parameters, and the target test case is used to test the corresponding object to be tested; Configuring the object to be tested as a test scenario corresponding to the target test case; Generate and send a test Http request according to the preset test parameters corresponding to the test scenario, so that the test scenario receives the test Http request and generates a corresponding request log after processing, and the test Http request is used to simulate user operations; Verify the request log according to the corresponding verification parameters and determine whether the test scenario has an abnormality according to the verification result; When the program instructions are read and executed by the one or more processors, the program instructions further perform the following operations: S1. Initialize the test environment and create an Http request proxy object, wherein each Http request proxy object records the scenario ID that each callback function pre-subscribes to, i.e., monitors. After monitoring the request log generated by the object to be tested, the HTTP request proxy object passes the request log to the callback function that monitors the scenario ID according to the scenario ID corresponding to the request log. The callback function determines whether the request log is generated by the test scenario monitored by the callback function according to the scenario ID corresponding to the request log. If it is determined to be, it verifies whether there is an exception according to the verification parameters. S2. Generate a proxy HTTP request, wherein the proxy HTTP request is used to send the generated test HTTP request simulating user behavior to the corresponding test scenario.
Citation Information
Cited By
Request log recording system
CN115563615A
