CN114900569B - Test script acquisition method and device - Google Patents
Test script acquisition method and device Download PDFInfo
- Publication number
- CN114900569B CN114900569B CN202210536545.9A CN202210536545A CN114900569B CN 114900569 B CN114900569 B CN 114900569B CN 202210536545 A CN202210536545 A CN 202210536545A CN 114900569 B CN114900569 B CN 114900569B
- Authority
- CN
- China
- Prior art keywords
- message
- services
- test script
- information
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000013515 script Methods 0.000 title claims abstract description 174
- 238000012360 testing method Methods 0.000 title claims abstract description 169
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000008859 change Effects 0.000 claims description 20
- 238000012795 verification Methods 0.000 claims description 7
- 230000001960 triggered effect Effects 0.000 claims description 5
- 230000002159 abnormal effect Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 4
- 230000010354 integration Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Mining & Analysis (AREA)
- Environmental & Geological Engineering (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a method and a device for acquiring a test script, which can be applied to the distributed field or the financial field. The method comprises the following steps: running a first test script corresponding to the application program; acquiring message information of a plurality of services corresponding to an application program based on a first test script; analyzing the message information to obtain second test scripts corresponding to the plurality of services; the second test script is used to test the plurality of services. Because the first test script is a test script aiming at the application program under the centralized architecture, when the application program is divided into a plurality of services, the external interface and the whole function are kept unchanged, so that a second test script corresponding to the plurality of services can be acquired by means of the first test script, and a tester does not need to write the test script again manually, thereby greatly reducing the working pressure of the tester and improving the working efficiency of the tester.
Description
Technical Field
The present application relates to the field of distributed technologies, and in particular, to a method and an apparatus for obtaining a test script.
Background
In recent years, with the development of emerging technologies such as big data and cloud computing, the traditional centralized architecture is gradually migrated to the distributed architecture, and the service granularity under the technical architecture is also reduced, so that a micro-service architecture is derived. The micro-service architecture may divide a single application into a plurality of smaller services that implement the business functions corresponding to the application through coordination.
For automated testing of applications, in conventional centralized architectures, a tester is required to write test scripts to verify the functionality of the entire application and the integration between the application's interface and external interfaces. When the centralized architecture is converted into the micro-service architecture, since the application program is divided into a plurality of services, a tester is required to write test scripts to verify the functions of each service and the integration between interfaces of each service, which results in higher complexity of writing the test scripts and aggravates the working pressure of the tester.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring a test script, which are used for automatically generating the test script under a micro-service architecture, so that the burden of a tester is reduced, and the working efficiency of the tester is improved.
In a first aspect, an embodiment of the present application provides a method for acquiring a test script, including:
Running a first test script corresponding to the application program;
Acquiring message information of a plurality of services corresponding to the application program based on the first test script;
Analyzing the message information to obtain second test scripts corresponding to the plurality of services; the second test script is used for testing the plurality of services.
Optionally, the analyzing the message information to obtain the second test scripts corresponding to the multiple services includes:
Determining a message field, identification information of the message field and a value corresponding to the message field from the message information;
based on the plurality of services, constructing script configuration information according to the message field, the identification information of the message field and the value corresponding to the message field;
And obtaining the second test script based on the script configuration information.
Optionally, the obtaining, based on the first test script, message information of a plurality of services corresponding to the application program includes:
intercepting the operation data of the first test script during operation to obtain basic message information corresponding to the application program; the types of the basic message information comprise a basic request message and a basic return message;
Disassembling the basic request message and the basic return message according to the plurality of services to respectively obtain a request message and a return message corresponding to the plurality of services;
Based on the plurality of services, and according to the request message and the return message, a message table for representing the message information is constructed.
Optionally, before the first test script corresponding to the running application program, the obtaining method further includes:
And injecting a service interceptor for intercepting the operation data into the plurality of services, and starting the service interceptor.
Optionally, the type of the message information includes a return message; the method further comprises the steps of:
Checking the returned message by using the second test script to obtain a checking result;
and when the verification result shows that the return message is abnormal, sending out a reminder.
Optionally, the method further comprises:
responding to a service change instruction triggered by a user to acquire service change information;
And updating the second test script based on the service change information.
In a second aspect, an embodiment of the present application provides an apparatus for acquiring a test script, including:
The script running module is used for running a first test script corresponding to the application program;
the information acquisition module is used for acquiring message information of a plurality of services corresponding to the application program according to the first test script;
The information analysis module is used for analyzing the message information to obtain second test scripts corresponding to the plurality of services; the second test script is used for testing the plurality of services.
Optionally, the information analysis module specifically includes:
the first analysis module is used for determining a message field, identification information of the message field and a value corresponding to the message field from the message information;
the second analysis module is used for constructing script configuration information based on the plurality of services and according to the message field, the identification information of the message field and the value corresponding to the message field;
and the third analysis module is used for obtaining the second test script based on the script configuration information.
Optionally, the information acquisition module specifically includes:
the first acquisition module is used for intercepting the operation data of the first test script during operation to obtain basic message information corresponding to the application program; the types of the basic message information comprise a basic request message and a basic return message;
the second acquisition module is used for disassembling the basic request message and the basic return message according to the plurality of services to respectively obtain a request message and a return message corresponding to the plurality of services;
And the third acquisition module is used for constructing a message table for representing the message information based on the plurality of services and according to the request message and the return message.
Optionally, the device for acquiring the test script further includes:
and the service interceptor control module is used for injecting a service interceptor for intercepting the operation data into the plurality of services and starting the service interceptor.
From the above technical solutions, the embodiment of the present application has the following advantages:
In the embodiment of the application, when the first test script corresponding to the application program is operated, the message information of a plurality of services corresponding to the application program can be obtained according to the first test script, and the message information is further analyzed to obtain the second test script corresponding to the plurality of services, so that the plurality of services are tested by using the second test script. Because the first test script is a test script aiming at the application program under the centralized architecture, when the application program is divided into a plurality of services, the external interface and the whole function are kept unchanged, so that a second test script corresponding to the plurality of services can be acquired by means of the first test script, and a tester does not need to write the test script again manually, thereby greatly reducing the working pressure of the tester and improving the working efficiency of the tester.
Drawings
FIG. 1 is a flowchart of a method for obtaining a test script according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for obtaining test scripts according to an embodiment of the present application;
Fig. 3 is a schematic structural diagram of an acquisition device for test scripts according to an embodiment of the present application.
Detailed Description
As described above, the inventors found in the study on the application test script that: for automated testing of applications, in conventional centralized architectures, a tester is required to write test scripts to verify the functionality of the entire application and the integration between the application's interface and external interfaces. When the centralized architecture is converted into the micro-service architecture, since the application program is divided into a plurality of services, a tester is required to write test scripts to verify the functions of each service and the integration between interfaces of each service, which results in higher complexity of writing the test scripts and aggravates the working pressure of the tester.
In order to solve the above problems, an embodiment of the present application provides a method for acquiring a test script, including: when the first test script corresponding to the application program is operated, message information of a plurality of services corresponding to the application program can be obtained according to the first test script, and the message information is further analyzed to obtain a second test script corresponding to the plurality of services, so that the plurality of services can be tested by the second test script.
Because the first test script is a test script aiming at the application program under the centralized architecture, when the application program is divided into a plurality of services, the external interface and the whole function are kept unchanged, so that a second test script corresponding to the plurality of services can be acquired by means of the first test script, and a tester does not need to write the test script again manually, thereby greatly reducing the working pressure of the tester and improving the working efficiency of the tester.
The data importing method and device provided by the invention can be used in the fields of artificial intelligence, blockchain, distributed, cloud computing, big data, internet of things, mobile interconnection, network security, chip, virtual reality, augmented reality, holographic technology, quantum computing, quantum communication, quantum measurement, digital twin or finance. The foregoing is merely an example, and is not intended to limit the application fields of the data importing method and apparatus provided by the present invention.
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1 is a flowchart of a method for obtaining a test script according to an embodiment of the present application. Referring to fig. 1, the method for acquiring a test script provided by the embodiment of the present application may include:
s101: and running a first test script corresponding to the application program.
The first test script corresponding to the application program refers to a test script used for testing the application program in a traditional centralized architecture. Specifically, the first test script may simulate sending the request message of the front-end webpage to the back-end system according to the preset service requirement corresponding to the application program, and verify the accuracy of the return message of the back-end system. Taking a deposit scenario as an example, in a centralized architecture, a first test script may simulate the following transaction paths when testing an application: and sending the information such as the account A, the deposit amount B, the deposit currency type C and the like to a banking core system as a request message, and checking whether a return message fed back by the banking core system comprises information for indicating that the deposit transaction is successful.
S102: and acquiring message information of a plurality of services corresponding to the application program based on the first test script.
The plurality of services corresponding to the application program means that when the centralized architecture is converted to the micro-service architecture, the application program can be divided into a plurality of corresponding services, and the services coordinate to complete the original complete functions of the application program. The message information refers to information transmitted among a plurality of services, and the type of the message information can specifically include a request message and a return message. Taking the above deposit scenario as an example, in the micro-service architecture, the plurality of services corresponding to the banking core system may include a gateway service, a master control service, an account inquiry service and an accounting service, and then the complete transaction path of the deposit scenario may be represented as: the gateway service sends the account A, the deposit amount B and the deposit currency type C as request messages to the total control service; the master control service sends the account A as a new request message to an account query service, and the account query service feeds back a return message for indicating the existence of the account A to the master control service; the general control service sends the account A, the deposit amount B and the deposit currency type C as new request messages to the accounting service, and the accounting service feeds back a return message for indicating successful deposit to the general control service; and the master control service feeds back a return message for representing successful transaction to the gateway service according to the return message fed back by the account inquiry service and the return message fed back by the accounting service, and feeds back the return message for representing successful transaction to the transaction initiator by the network management service.
In addition, the embodiment of the present application may not limit the manner of acquiring the message information of the plurality of services corresponding to the application program, and for convenience of understanding, the following description will be made with reference to a possible implementation manner.
In one possible implementation, S102 may include: intercepting operation data of the first test script in operation to obtain basic message information corresponding to an application program; the types of the basic message information comprise a basic request message and a basic return message; disassembling the basic request message and the basic return message according to a plurality of services to respectively obtain a request message and a return message corresponding to the plurality of services; based on a plurality of services, and according to the request message and the return message, a message table for representing message information is constructed. The basic message information refers to message information when the first test script is adopted to test the application program of the centralized architecture. Taking the above deposit scenario as an example, in the centralized architecture, when the application program is tested by using the first test script, the basic request message may include an account a, a deposit amount B, and a deposit currency type C; the base return message may include information indicating that the deposit transaction was successful. Because the first test script is a test script aiming at the application program under the centralized architecture, when the application program is divided into a plurality of services, the external interface and the whole function are kept unchanged, so that the operation data can be analyzed and processed to obtain a second test script corresponding to the plurality of services by intercepting the operation data of the first test script when the operation data is operated, the second test script is obtained by the first test script, and a tester does not need to write the test script again manually, thereby greatly reducing the working pressure of the tester and improving the working efficiency of the tester.
Correspondingly, in order to intercept the running data, before the first test script corresponding to the application program is run, a service interceptor for intercepting the running data is injected into a plurality of services, and the service interceptor is started so as to intercept and record the running data by using the service interceptor. Wherein the service interceptor may be developed in advance by a Java (a computer programming language) program. The service interceptor may utilize AOP (Aspect Oriented Programming, slice-oriented programming) slice technology of a Spring framework (an open source Java application framework), injected at the control layer of multiple services to achieve interception of running data.
In addition, the representation form of the message table is not particularly limited, and the message table is described in the form of table 1 for the sake of understanding.
TABLE 1
The message information of each of the plurality of services may correspond to the same message table, that is, the message information of each of the plurality of services is represented in the same message table, or the message information of each of the plurality of services may correspond to different message tables, that is, the message information of each of the plurality of services is represented in each of the message tables, which may not be particularly limited in the embodiment of the present application.
S103: and analyzing the message information to obtain second test scripts corresponding to the plurality of services.
The second test script refers to a test script for testing a plurality of services split into the application system. Taking the above deposit scenario as an example, in the micro-service architecture, the second test script may simulate the following transaction paths when testing the plurality of applications: the account A, the deposit amount B and the deposit currency type C are used as request messages of gateway services to the total control service; sending the account A as a request message of the total control service to an account query service, and checking whether a return message fed back by the account query service comprises information for representing the existence of the account A; sending a new request message of the account A, the deposit amount B and the deposit currency type C as a general control service to an accounting service, and checking whether a return message fed back by the accounting service comprises information for indicating successful deposit; and feeding back the message determined by the feedback message of the account inquiry service and the feedback message of the accounting service as the feedback message of the total control service to the gateway service, and checking whether the feedback message of the total control service comprises information for representing successful transaction.
The process of obtaining the second test script may not be specifically limited in the embodiments of the present application. For ease of understanding, the following description is provided in connection with one possible embodiment.
In one possible implementation manner, S103 may specifically include: determining a message field, identification information of the message field and a value corresponding to the message field from the message information; based on a plurality of services, constructing script configuration information according to the message field, the identification information of the message field and the value corresponding to the message field; and obtaining a second test script based on the script configuration information. The form of representation of the script configuration information is not particularly limited, and for convenience of understanding, the script configuration information will be described in table 2.
TABLE 2
The message field, the identification information of the message field, and the value corresponding to the message field, which are respectively determined from the request message and the return message of the same service, may be represented in the same table, or may be respectively represented in different tables, which is not particularly limited in the embodiment of the present application. In addition, the message field, the identification information of the message field, and the value corresponding to the message field, which are respectively determined in the request message and the return message of each of the plurality of services, may be represented in the same table, or may be represented in different tables, which is not particularly limited in the embodiment of the present application.
Based on the above description of S101 to S103, in the embodiment of the present application, when a first test script corresponding to an application program is run, message information of a plurality of services corresponding to the application program may be obtained according to the first test script, and the message information may be further analyzed to obtain a second test script corresponding to the plurality of services, so that the plurality of services may be tested by using the second test script. Because the first test script is a test script aiming at the application program under the centralized architecture, when the application program is divided into a plurality of services, the external interface and the whole function are kept unchanged, so that a second test script corresponding to the plurality of services can be acquired by means of the first test script, and a tester does not need to write the test script again manually, thereby greatly reducing the working pressure of the tester and improving the working efficiency of the tester.
In addition, in order to test whether the service meets the preset service requirement, the embodiment of the application can utilize the second test script to check the message information of the plurality of services so as to judge whether the service meets the preset service requirement. Furthermore, in order to improve the test efficiency, only the returned message can be checked to judge whether the service is accurately finished, so that the service effectiveness is improved while the test efficiency is improved. Specifically, the second test script can be utilized to check the return message to obtain a check result; and when the verification result shows that the return message is abnormal, sending out a reminder. Here, the return message exception may be reflected in that a value corresponding to a return field in the return message does not conform to a preset value. In addition, the embodiment of the application can send out a prompt through various implementation modes, and is exemplified below.
As an example, if the verification result can be uploaded to the cloud server, a reminder may be sent by the cloud server sending an instruction. For example, the cloud server may be communicatively connected to a terminal device associated with the tester to send the test results and/or the alert information to the tester.
As another example, if the micro-service architecture is mounted on a terminal device configured with an information reminding device, a reminder may be sent out by the information reminding device. For example, the information reminding device may be a light emitting device, and the reminding device may be turned on or turned off by the light emitting device. Or the information reminding device can be a sound generating device, and the reminding is sent out by the mode that the sound generating device sends out the reminding sound. The prompting sound can be a ringing sound effect preset by a tester, or can be a return message for broadcasting the abnormality through voice, and the embodiment of the application is not particularly limited.
The terminal device is, for example, a mobile device, a computer, etc., or any combination thereof. In some embodiments, the mobile device may include a cell phone, a wearable device, a tablet, a virtual reality device, etc., or any combination thereof.
In order to expand the usability of the second test script and improve the intelligent degree of the acquisition method of the test script, the embodiment of the application can also provide another acquisition method of the test script. The method for acquiring the test script will be described below with reference to the embodiments and the drawings, respectively.
Fig. 2 is a flowchart of another method for obtaining a test script according to an embodiment of the present application. Referring to fig. 2, the method for acquiring a test script according to the embodiment of the present application may include:
s201: and running a first test script corresponding to the application program.
S202: and acquiring message information of a plurality of services corresponding to the application program based on the first test script.
S203: and analyzing the message information to obtain second test scripts corresponding to the plurality of services.
S204: and responding to the service change instruction triggered by the user to acquire the service change information.
The service change instruction refers to an instruction triggered by a user, that is, the tester based on the adjustment requirement of the service. In this regard, the embodiment of the present application may not specifically limit the triggering manner of the service change instruction. For example, the user may trigger the service change instruction by clicking a control corresponding to the service change information, or may trigger the service change instruction by opening or updating the service change information, or may trigger the service change instruction at a preset time point, which is preset by the user.
S205: and updating the second test script based on the service change information.
Here, updating the second test script may be embodied as updating the script configuration information in the above embodiment to cover the original script configuration information, or may be embodied as adding new script configuration information, while retaining the original script configuration information.
In addition, when the updated second test script is used for testing the plurality of services subsequently, all the services can be tested by using the updated second test script, and the updated services can be tested by using the script corresponding to the updated services in the updated second test script, so that the effect of rapid testing is achieved.
Based on the method for acquiring the test script provided by the embodiment, the embodiment of the application also provides a device for acquiring the test script. The acquisition device of the test script is described below with reference to the embodiments and the drawings, respectively.
Fig. 3 is a schematic structural diagram of an acquisition device for test scripts according to an embodiment of the present application. Referring to fig. 3, an apparatus 300 for obtaining a test script according to an embodiment of the present application may include:
the script running module 301 is configured to run a first test script corresponding to the application program;
The information obtaining module 302 is configured to obtain message information of a plurality of services corresponding to an application program according to a first test script;
The information analysis module 303 is configured to analyze the message information to obtain second test scripts corresponding to the multiple services; the second test script is used to test the plurality of services.
As an embodiment, to reduce the working pressure of the tester and improve the working efficiency of the tester, the information analysis module 303 may specifically include:
The first analysis module is used for determining a message text segment, identification information of the message field and a value corresponding to the message text segment from the message information;
The second analysis module is used for constructing script configuration information based on a plurality of services according to the message field, the identification information of the message field and the value corresponding to the message field;
And the third analysis module is used for obtaining a second test script based on the script configuration information.
As an embodiment, to reduce the working pressure of the tester and improve the working efficiency of the tester, the information obtaining module 302 may specifically include:
The first acquisition module is used for intercepting the operation data of the first test script during operation to obtain basic message information corresponding to the application program; the types of the basic message information comprise a basic request message and a basic return message;
The second acquisition module is used for disassembling the basic request message and the basic return message according to the plurality of services to respectively obtain the request message and the return message corresponding to the plurality of services;
And the third acquisition module is used for constructing a message table for representing message information based on a plurality of services and according to the request message and the return message.
As an embodiment, to reduce the working pressure of the tester and improve the working efficiency of the tester, the test script obtaining apparatus 300 may further include:
and the service interceptor control module is used for injecting a service interceptor for intercepting the operation data into a plurality of services and starting the service interceptor.
As an embodiment, to reduce the working pressure of the tester and improve the working efficiency of the tester, the test script obtaining apparatus 300 may further include:
the verification module is used for verifying the return message by using the second test script to obtain a verification result;
And the reminding module is used for sending out a reminder when the verification result shows that the return message is abnormal.
As an embodiment, to reduce the working pressure of the tester and improve the working efficiency of the tester, the test script obtaining apparatus 300 may further include:
The service change information acquisition module is used for responding to a service change instruction triggered by a user to acquire service change information;
And the updating module is used for updating the second test script based on the service change information.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (6)
1. The method for acquiring the test script is characterized by comprising the following steps:
Running a first test script corresponding to the application program;
Acquiring message information of a plurality of services corresponding to the application program based on the first test script;
Analyzing the message information to obtain second test scripts corresponding to the plurality of services; the second test script is used for testing the plurality of services;
The analyzing the message information to obtain the second test script corresponding to the plurality of services includes:
Determining a message field, identification information of the message field and a value corresponding to the message field from the message information;
based on the plurality of services, constructing script configuration information according to the message field, the identification information of the message field and the value corresponding to the message field; the script configuration information comprises identification information associated with the plurality of services, identification information associated with interfaces corresponding to the plurality of services, the message field, the identification information of the message field and a value corresponding to the message field;
obtaining the second test script based on the script configuration information;
the step of obtaining the message information of the plurality of services corresponding to the application program based on the first test script includes:
intercepting the operation data of the first test script during operation to obtain basic message information corresponding to the application program; the types of the basic message information comprise a basic request message and a basic return message;
Disassembling the basic request message and the basic return message according to the plurality of services to respectively obtain a request message and a return message corresponding to the plurality of services;
Based on the plurality of services, and according to the request message and the return message, a message table for representing the message information is constructed.
2. The method of claim 1, wherein prior to the running the first test script corresponding to the application, the obtaining method further comprises:
And injecting a service interceptor for intercepting the operation data into the plurality of services, and starting the service interceptor.
3. The method according to claim 1 or 2, wherein the type of message information comprises a return message; the method further comprises the steps of:
Checking the returned message by using the second test script to obtain a checking result;
and when the verification result shows that the return message is abnormal, sending out a reminder.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
responding to a service change instruction triggered by a user to acquire service change information;
And updating the second test script based on the service change information.
5. An acquisition device of a test script, comprising:
The script running module is used for running a first test script corresponding to the application program;
the information acquisition module is used for acquiring message information of a plurality of services corresponding to the application program according to the first test script;
The information analysis module is used for analyzing the message information to obtain second test scripts corresponding to the plurality of services; the second test script is used for testing the plurality of services;
The information analysis module specifically comprises:
the first analysis module is used for determining a message field, identification information of the message field and a value corresponding to the message field from the message information;
The second analysis module is used for constructing script configuration information based on the plurality of services and according to the message field, the identification information of the message field and the value corresponding to the message field; the script configuration information comprises identification information associated with the plurality of services, identification information associated with interfaces corresponding to the plurality of services, the message field, the identification information of the message field and a value corresponding to the message field;
The third analysis module is used for obtaining the second test script based on the script configuration information;
The information acquisition module specifically comprises:
the first acquisition module is used for intercepting the operation data of the first test script during operation to obtain basic message information corresponding to the application program; the types of the basic message information comprise a basic request message and a basic return message;
the second acquisition module is used for disassembling the basic request message and the basic return message according to the plurality of services to respectively obtain a request message and a return message corresponding to the plurality of services;
And the third acquisition module is used for constructing a message table for representing the message information based on the plurality of services and according to the request message and the return message.
6. The apparatus of claim 5, wherein the means for obtaining the test script further comprises:
and the service interceptor control module is used for injecting a service interceptor for intercepting the operation data into the plurality of services and starting the service interceptor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210536545.9A CN114900569B (en) | 2022-05-17 | 2022-05-17 | Test script acquisition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210536545.9A CN114900569B (en) | 2022-05-17 | 2022-05-17 | Test script acquisition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114900569A CN114900569A (en) | 2022-08-12 |
CN114900569B true CN114900569B (en) | 2024-05-03 |
Family
ID=82724923
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210536545.9A Active CN114900569B (en) | 2022-05-17 | 2022-05-17 | Test script acquisition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114900569B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103984626A (en) * | 2014-05-13 | 2014-08-13 | 华为技术有限公司 | Method and device for generating test-case script |
CN106294172A (en) * | 2016-08-17 | 2017-01-04 | 刘华英 | App self-testing method based on terminal unit and device |
CN108459958A (en) * | 2017-12-08 | 2018-08-28 | 平安科技(深圳)有限公司 | The creation method of function and performance test script, device, equipment and storage medium |
CN109726128A (en) * | 2018-12-29 | 2019-05-07 | 亚信科技(中国)有限公司 | A kind of method for generating test case, device and server |
CN111949545A (en) * | 2020-08-19 | 2020-11-17 | 彩讯科技股份有限公司 | Automatic testing method, system, server and storage medium |
CN112346991A (en) * | 2020-11-27 | 2021-02-09 | 新华三大数据技术有限公司 | Interface test script generation method and device |
CN112685298A (en) * | 2020-12-25 | 2021-04-20 | 北京百度网讯科技有限公司 | Code coverage testing method and device for application program and electronic equipment |
CN113032257A (en) * | 2021-03-19 | 2021-06-25 | 中国工商银行股份有限公司 | Automatic test method, device, computer system and readable storage medium |
CN114003510A (en) * | 2021-11-30 | 2022-02-01 | 平安付科技服务有限公司 | Script testing method, device, equipment and medium based on Mock service |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8490056B2 (en) * | 2010-04-28 | 2013-07-16 | International Business Machines Corporation | Automatic identification of subroutines from test scripts |
-
2022
- 2022-05-17 CN CN202210536545.9A patent/CN114900569B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103984626A (en) * | 2014-05-13 | 2014-08-13 | 华为技术有限公司 | Method and device for generating test-case script |
CN106294172A (en) * | 2016-08-17 | 2017-01-04 | 刘华英 | App self-testing method based on terminal unit and device |
CN108459958A (en) * | 2017-12-08 | 2018-08-28 | 平安科技(深圳)有限公司 | The creation method of function and performance test script, device, equipment and storage medium |
CN109726128A (en) * | 2018-12-29 | 2019-05-07 | 亚信科技(中国)有限公司 | A kind of method for generating test case, device and server |
CN111949545A (en) * | 2020-08-19 | 2020-11-17 | 彩讯科技股份有限公司 | Automatic testing method, system, server and storage medium |
CN112346991A (en) * | 2020-11-27 | 2021-02-09 | 新华三大数据技术有限公司 | Interface test script generation method and device |
CN112685298A (en) * | 2020-12-25 | 2021-04-20 | 北京百度网讯科技有限公司 | Code coverage testing method and device for application program and electronic equipment |
CN113032257A (en) * | 2021-03-19 | 2021-06-25 | 中国工商银行股份有限公司 | Automatic test method, device, computer system and readable storage medium |
CN114003510A (en) * | 2021-11-30 | 2022-02-01 | 平安付科技服务有限公司 | Script testing method, device, equipment and medium based on Mock service |
Also Published As
Publication number | Publication date |
---|---|
CN114900569A (en) | 2022-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108415832B (en) | Interface automation test method, device, equipment and storage medium | |
CN109344642B (en) | Interface rule checking method, device, computer equipment and storage medium | |
CN109582301B (en) | Service processing method, device, equipment and medium based on task scheduling system | |
CN110782240B (en) | Business data processing method and device, computer equipment and storage medium | |
CN110489699B (en) | Asynchronous data acquisition method and system | |
CN108563567B (en) | Automated testing method, apparatus, device and computer readable storage medium | |
US9483386B2 (en) | Information interaction test device and method based on automatic generation of associated test cases | |
US10824549B1 (en) | System and method for regression testing of an application programming interface | |
CN110941630A (en) | Database operation and maintenance method, device and system | |
CN110069297A (en) | Abnormality eliminating method, device, computer equipment and storage medium based on Spring MVC | |
CN107436844A (en) | A kind of generation method and device of interface use-case intersection | |
CN111522728A (en) | Method for generating automatic test case, electronic device and readable storage medium | |
WO2019104891A1 (en) | Method and device for importing and exporting report, storage medium, and terminal | |
CN106713011B (en) | Method and system for obtaining test data | |
CN108255967B (en) | Method and device for calling storage process, storage medium and terminal | |
CN114168190A (en) | Interface document generation method and device, computer equipment and storage medium | |
CN111352997A (en) | Test environment verification method and system | |
CN110443044A (en) | Block chain client bug excavation method, device, equipment and storage medium | |
CN113761064A (en) | Block chain based daily cutting account checking method, device, equipment and readable storage medium | |
CN114900569B (en) | Test script acquisition method and device | |
CN114895879B (en) | Management system design scheme determining method, device, equipment and storage medium | |
CN111159033A (en) | Software testing method and device | |
CN115934537A (en) | Interface test tool generation method, device, equipment, medium and product | |
CN110362294A (en) | Development task executes method, apparatus, electronic equipment and storage medium | |
CN110309062B (en) | Use case generation method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |