CN110727588B - Network application testing method, system, computer equipment and readable storage medium - Google Patents

Network application testing method, system, computer equipment and readable storage medium Download PDF

Info

Publication number
CN110727588B
CN110727588B CN201910933292.7A CN201910933292A CN110727588B CN 110727588 B CN110727588 B CN 110727588B CN 201910933292 A CN201910933292 A CN 201910933292A CN 110727588 B CN110727588 B CN 110727588B
Authority
CN
China
Prior art keywords
target
test
state
service request
interceptor
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
Application number
CN201910933292.7A
Other languages
Chinese (zh)
Other versions
CN110727588A (en
Inventor
盛超杰
黄勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dasou Vehicle Software Technology Co Ltd
Original Assignee
Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Dasou Vehicle Software Technology Co Ltd filed Critical Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority to CN201910933292.7A priority Critical patent/CN110727588B/en
Publication of CN110727588A publication Critical patent/CN110727588A/en
Application granted granted Critical
Publication of CN110727588B publication Critical patent/CN110727588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application relates to a network application testing method, a network application testing system, computer equipment and a readable storage medium. The method comprises the following steps: the testing tool sends a target testing instruction to the network application; the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction; the interceptor redirects the target service request to the test server; the test server determines a target return value corresponding to the target service request in the corresponding relation between the pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relation between the service request and the return value is established according to each test instruction and the target value corresponding to each test instruction; and the test tool determines a test result according to the target return value and a target value corresponding to a pre-stored target test instruction. The application can improve the testing accuracy.

Description

Network application testing method, system, computer equipment and readable storage medium
Technical Field
The present application relates to the field of network application detection technologies, and in particular, to a method, a system, a computer device, and a readable storage medium for testing a network application.
Background
With the development of network application technology, the variety of network applications is increasing, and before the network applications are put into use, technicians need to test the network applications. Currently, technicians typically employ test tools to test web applications. The network application may send a service request to the third party server according to the test instruction sent by the test tool. The third party server can determine a return value according to the service request, send the return value to the client, send the return value to the testing tool by the client, judge whether the return value is the same as a target value corresponding to the pre-stored testing instruction by the testing tool, and obtain a testing result according to the judging result.
However, if the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool, the return value determined by the third party server according to the service request sent by the network application is different from the target value determined by the test tool, so that the test tool obtains an incorrect test result, and the test accuracy of the test tool is lower. Meanwhile, the test tool provides test data for the third-party server, and the operation of the third-party server is affected.
Disclosure of Invention
In view of this, it is necessary to address the above-described technical problems, A method, system, computer device and readable storage medium for testing a network application are provided.
In a first aspect, a method for testing a network application is provided, where the method is applied to a network application testing system, and the network application testing system includes a testing tool, a network application, an interceptor, and a testing server, and the method includes:
the test tool sends a target test instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a corresponding relation between a pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relation between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the testing tool determines a testing result according to the target return value and a target value corresponding to the pre-stored target testing instruction.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
As an optional implementation manner, the test server stores a return value corresponding to each service request in advance, and the return value is determined according to a data structure of the return value corresponding to the service request stored in advance in the network application and a preset return value setting rule.
Before testing the network application, pre-configuring the return value for the test server according to the pre-stored data structure of the return value of the service request in the network application, thereby ensuring the stability and accuracy of the return test return value in the test process of the test server.
As an alternative embodiment, before the interceptor redirects the target service request to the test server, the method further comprises:
the interceptor judges whether the state of the test server is an on state, and if the state of the test server is an on state, the interceptor redirects the target service request to the test server;
and if the state of the test server is a closed state, the interceptor sends the target service request to the third party server.
The target service request is redirected to the test server through the interceptor, so that the network application test result is not influenced by the third party server, the test accuracy is improved, and meanwhile, if the test server is in a closed state, the third party server is continuously called, and the third party server plays a role in auxiliary test.
As an optional implementation manner, the target service request includes a target interface and a target method, and the interceptor redirects the target service request to the test server, including:
the interceptor judges whether the state of the target interface is an on state, and if the state of the target interface is an on state, the interceptor redirects the target service request to the test server;
and if the interface state of the target interface is the closed state, the interceptor judges whether the state of the target method is the open state, and if the state of the target method is the open state, the interceptor redirects the target service request to the test server.
After receiving the target service request, the interceptor needs to judge the on-off state of the interface and the method of the test server, and if the interface and the method of the test server are in the on-state, the interceptor redirects the service request to the test server, and the accurate test process is ensured through the judging and redirecting processes of the interceptor.
As an alternative embodiment, the method further comprises:
and if the state of the target method is the closed state, the interceptor sends the target service request to the third party server.
If the interface and the method state of the test server are in the closed state, the interceptor sends the target service request to the third party server, so that the complete execution of the test process is ensured, and the third party server also has the function of assisting in the test.
In a second aspect, a network application testing system is provided, the network application testing system comprising a testing tool, a network application, an interceptor and a testing server;
the test tool is used for sending a target test instruction to the network application;
the network application is used for sending a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor is used for redirecting the target service request to the test server;
the test server is used for determining a target return value corresponding to the target service request in a corresponding relation between the pre-stored service request and the return value, and transmitting the target return value to the test tool through the interceptor and the network application, wherein the corresponding relation between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
the test tool is further used for determining a test result according to the target return value and a target value corresponding to the target test instruction stored in advance.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
As an optional implementation manner, the test server stores a return value corresponding to each service request in advance, and the return value is determined according to a data structure of the return value corresponding to the service request stored in advance in the network application and a preset return value setting rule.
Before testing the network application, pre-configuring the return value for the test server according to the pre-stored data structure of the return value of the service request in the network application, thereby ensuring the stability and accuracy of the return test return value in the test process of the test server.
As an optional implementation manner, the interceptor is configured to determine whether the state of the test server is an on state, and redirect the target service request to the test server if the state of the test server is an on state;
the interceptor is further configured to send the target service request to the third party server if the state of the test server is a closed state.
The target service request is redirected to the test server through the interceptor, so that the network application test result is not influenced by the third party server, the test accuracy is improved, and meanwhile, if the test server is in a closed state, the third party server is continuously called, and the third party server plays a role in auxiliary test.
As an optional implementation manner, the target service request includes a target interface and a target method, and the interceptor is configured to determine whether the state of the target interface is an on state, and if the state of the target interface is an on state, redirect the target service request to the test server;
the interceptor is further configured to determine whether the state of the target method is an on state if the interface state of the target interface is an off state, and redirect the target service request to the test server if the state of the target method is an on state.
After receiving the target service request, the interceptor needs to judge the on-off state of the interface and the method of the test server, and if the interface and the method of the test server are in the on-state, the interceptor redirects the service request to the test server, and the accurate test process is ensured through the judging and redirecting processes of the interceptor.
As an alternative embodiment, the interceptor is configured to send the target service request to the third party server if the state of the target method is a closed state.
If the interface and the method state of the test server are in the closed state, the interceptor sends the target service request to the third party server, so that the complete execution of the test process is ensured, and the third party server also has the function of assisting in the test.
In a third aspect, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of:
the test tool sends a target test instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a corresponding relation between a pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relation between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the testing tool determines a testing result according to the target return value and a target value corresponding to the pre-stored target testing instruction.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
the test tool sends a target test instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a corresponding relation between a pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relation between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the testing tool determines a testing result according to the target return value and a target value corresponding to the pre-stored target testing instruction.
The embodiment of the application provides a test method, a system, computer equipment and a readable storage medium for a network application, wherein a test tool sends a target test instruction to the network application, the network application sends a target service request according to the target test instruction, the target service request is redirected to a test server through an interceptor, the test server determines a target return value corresponding to the target service request in a corresponding relation between a pre-stored service request and a return value, the target return value is transmitted to the test tool through the interceptor and the network application, and the test tool determines a test result according to pre-configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
Drawings
FIG. 1 is a schematic diagram of a network application test system according to an embodiment of the present application;
fig. 2 is a flowchart of a testing method of a network application according to an embodiment of the present application;
fig. 3 is a flowchart of an example of a testing method of a network application according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a network application testing system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a network application testing method which can be applied to a network application testing system. Fig. 1 is a schematic diagram of a network application testing system according to an embodiment of the present application. As shown in fig. 1, the network test system includes a test tool, a network application, an interceptor, and a test server. The testing tool is used for sending a target testing instruction to the network application; the network application is used for sending a target service request aiming at the third-party server to the interceptor according to the received target test instruction; an interceptor for redirecting the target service request to the test server; the test server is used for determining a target return value corresponding to the target service request according to the corresponding relation between the pre-stored service request and the return value, transmitting the target return value to the test tool through the interceptor and the network application, and determining a test result according to the target return value and the target value corresponding to the pre-stored target test instruction. The test server may be a Mock (a micro service) type test server, a dubbo (a service framework) type test server, or other types of test servers, which is not limited in the embodiment of the present application. The embodiment of the application is described by taking the test server as a Mock type test server as an example, and other conditions are similar to the test server. The network test system may also include a third party server. And the third-party server is used for receiving the target service request sent by the interceptor and determining the return value corresponding to the target service request according to a determination algorithm of the return value. The third party server may be a dubbo type test server, and may also be other types of test servers, which are not limited in the embodiment of the present application. The embodiment of the application is introduced by taking the third party server as a dubbo type third party server as an example, and other conditions are similar to the third party server.
The embodiment of the application provides a network application testing method, as shown in fig. 2, comprising the following specific processing steps:
step 201: the test tool sends a target test instruction to the network application.
In implementation, when a technician needs to test a certain function (hereinafter referred to as a target function) of a network application, the technician may click a test button corresponding to the target function in a test interface of a test tool, and the test tool receives a test request instruction for the target function. The test tool may then send test instructions (i.e., target test instructions) for the function to the web application. Alternatively, the test tool may be: sibrent, lxia (test tool named company name), etc., the present application is not particularly limited. Alternatively, the web application is an application software operating on the internet or an intranet using a web browser, and may be: panning web applications, etc., the present application is not particularly limited.
Step 202: and the network application sends a target service request aiming at the third-party server to the interceptor according to the target test instruction.
In an implementation, after receiving a target test instruction sent by a test tool, the network application may generate a target service request of a dubbo protocol type for the third party server according to the target test instruction, and send the service request to the interceptor.
Step 203: the interceptor redirects the target service request to the test server.
In implementation, after receiving a target service request sent by a network application, an interceptor converts a target service request of a dubbo protocol type into a target service request of an http protocol type and sends the target service request of the http protocol type to a test server. The embodiment of the application is described by taking the example of converting the dubbo protocol into the http protocol type, and can also convert the dubbo protocol into other types of protocols. The embodiments of the present application are not limited.
The target service request comprises a target interface and a target method, and the processing procedure of redirecting the target service request to the test server by the interceptor is as follows:
step one, the interceptor judges whether the switch state of the target interface is an on state.
In an implementation, the interceptor may determine, in the pre-stored configuration information, whether the switch state of the target interface is an on state. And if the interface switch state of the target interface is an on state, the interceptor executes the step two. If the switch state of the target interface is the off state, the interceptor executes the steps three to five.
And step two, the interceptor redirects the target service request to the test server.
In implementation, if the on-off state of the target interface is the on-state, the on-off state of the target method included in the target interface is also the on-state, so the interceptor can directly redirect the target service request to the test server without judging the state of the target method.
And step three, the interceptor judges whether the on-off state of the target method is an on state.
In implementation, if the interface switch state of the target interface is an off state, the interceptor needs to further determine whether the switch state of the target method is an on state. If the switch state of the target method is the on state, the interceptor executes step four. If the switch state of the target method is the off state, the interceptor executes step five.
And step four, the interceptor redirects the target service request to the test server.
In implementations, if the on-off state of the target method is an on state, the interceptor may redirect the target service request to the test server.
And step five, the interceptor sends the target service request to the third party server.
In implementations, if the on-off state of the target method is an off state, the interceptor may send the target service request to the third party server.
As an alternative implementation manner, before the interceptor redirects the target service request to the test server, the interceptor may further process the target server request according to the state of the test server, where the specific processing procedure is as follows:
step one, the interceptor judges whether the switch state of the test server is an on state.
In implementation, after receiving a target service request sent by a network application, the interceptor may determine, in the pre-stored configuration information, whether the on/off state of the test server is an on state. And if the switch state of the test server is the on state, the interceptor executes the step two. If the switch state of the test server is the off state, the interceptor executes the step three.
And step two, the interceptor redirects the target service request to the test server.
In implementations, if the switch state of the test server is an on state, indicating that the test server is enabled, the interceptor may redirect the target service request to the test server.
And step three, the interceptor sends the target service request to a third party server.
In an implementation, if the switch state of the test server is in the off state, which indicates that the test server is not enabled, the interceptor may send the target service request to the third party server to ensure the integrity of the network application test.
Step 204: and the test server determines a target return value corresponding to the target service request in the corresponding relation between the pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application.
The corresponding relation between the service request and the return value is established according to each test instruction and the corresponding target value of each test instruction.
In implementation, the test server may have a correspondence between the service request and the return value stored in advance. The corresponding relation between the service request and the return value can be established by a technician according to preset test instructions and target values corresponding to the test instructions. The corresponding relation between the test instruction preset by the technician and the target value is stored in the test tool. When configuring the test server, a technician can set the return value of the service request corresponding to the test instruction as the target value corresponding to the test instruction, so that the target value of the test instruction is consistent with the return value of the service request corresponding to the test instruction.
After receiving the target service request sent by the interceptor, the test server can determine a target return value corresponding to the target service request in the corresponding relation between the pre-stored service request and the return value, and send the target return value to the interceptor. The interceptor packages the target return value as a dubbo result object for transmission to the test tool through the web application.
As an alternative implementation manner, the test server stores a return value corresponding to each service request in advance, and the return value is determined according to a data structure of the return value corresponding to the service request stored in advance in the network application and a preset return value setting rule.
In implementation, a jar (Java) Archive package of a third-party server is stored in a network application, where the jar package includes a plurality of service requests and a data structure of a return value corresponding to each service request, and when a technician configures a return value preset in a test server, the technician can configure the return value of each service request in the test server according to the data structure of the return value of each service request and a corresponding return value setting rule.
It should be noted that, because the service request includes an interface and a method, the corresponding relationship between the service request and the return value is the corresponding relationship between the interface, the method and the return value. The return value may be a numerical value, a character string, or the like, and the data structure of the return value is json (a data structure), or may be other types of data structures, which is not limited in the embodiment of the present application.
Step 205: and the test tool determines a test result according to the target return value and a target value corresponding to a pre-stored target test instruction.
In implementation, the test tool may store a target value corresponding to the target test instruction preset by the technician in advance, and after receiving the target return value, the test tool may determine whether the target value corresponding to the target test instruction is the same as the target return value. If the target value is the same as the target return value, the test result is that the target function of the network application is normal. If the target value is different from the target return value, the test result is that the target function of the network application is abnormal.
The embodiment of the application also provides an example of a testing method of the network application, as shown in fig. 3, the processing procedure is as follows:
in step 301, the test tool sends a target test instruction to the web application.
In step 302, the network application sends a target service request for the third party server to the interceptor according to the target test instruction. The target service request comprises a target interface and a target method.
In step 303, the interceptor determines whether the switch state of the test server is an on state.
If the switch state of the test server is on, the interceptor performs step 304.
If the switch state of the test server is the off state, the interceptor performs step 307.
In step 304, the interceptor determines whether the switch state of the target interface is an on state.
If the switch state of the target interface is on, the interceptor performs step 306.
If the interface switch state of the target interface is an off state, the interceptor performs step 305.
In step 305, the interceptor determines whether the on/off state of the target method is an on state.
If the switch state of the target method is an on state, the interceptor performs step 306.
If the switch state of the target method is the off state, then the interceptor performs step 307
At step 306, the interceptor redirects the target service request to the test server.
The interceptor sends the target service request to the third party server, step 307.
The processing procedures of steps 301 to 307 are similar to those of steps 201 to 205, and will not be repeated here.
The embodiment of the application provides a test method of a network application, wherein a test tool sends a target test instruction to the network application, the network application sends a target service request according to the target test instruction, the target service request is redirected to a test server through an interceptor, the test server determines a target return value corresponding to the target service request in a corresponding relation between the pre-stored service request and the return value, the target return value is transmitted to the test tool through the interceptor and the network application, and the test tool determines a test result according to the pre-configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
The embodiment of the application also provides a network application test system, as shown in fig. 4, which comprises:
a test tool 410 for sending a target test instruction to a web application 420;
a web application 420 for sending a target service request for a third party server to an interceptor 430 according to the target test instruction;
interceptor 430 for redirecting the target service request to test server 440;
the test server 440 is configured to determine a target return value corresponding to the target service request in a pre-stored correspondence between the service request and the return value, and transmit the target return value to the test tool 410 through the interceptor 430 and the network application 420, where the correspondence between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
the test tool 410 is further configured to determine a test result according to the target return value and a target value corresponding to a pre-stored target test instruction.
As an alternative embodiment, the test server 440 stores in advance a return value corresponding to each service request, where the return value is determined according to a data structure of the return value corresponding to the service request stored in advance in the network application 420 and a preset return value setting rule.
As an alternative embodiment, the interceptor 430 is configured to determine whether the switch state of the test server 440 is an on state, and redirect the target service request to the test server 440 if the switch state of the test server 440 is an on state;
interceptor 430 is also configured to send the target service request to the third party server if the switch state of test server 440 is an off state.
As an alternative embodiment, the target service request includes a target interface and a target method, and the interceptor 430 is configured to determine whether the on-off state of the target interface is an on state, and if the on-off state of the target interface is an on state, redirect the target service request to the test server 440;
interceptor 430 is further configured to determine whether the on/off state of the target method is an on state if the on/off state of the interface of the target interface is an off state, and redirect the target service request to test server 440 if the on/off state of the target method is an on state.
As an alternative embodiment, interceptor 430 is configured to send the target service request to the third party server if the on-off state of the target method is an off state.
The embodiment of the application provides a test system of a network application, wherein a test tool sends a target test instruction to the network application, the network application sends a target service request according to the target test instruction, the target service request is redirected to a test server through an interceptor, the test server determines a target return value corresponding to the target service request in a corresponding relation between the pre-stored service request and the return value, the target return value is transmitted to the test tool through the interceptor and the network application, and the test tool determines a test result according to the pre-configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third party server is different from the calculation method for determining the target value by the test tool can be avoided. And further, the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the testing server, so that the third party server is ensured to only process the service request sent by the network application when the actual service is processed, and the service performance of the third party server is further improved.
In one embodiment, as shown in fig. 5, a computer device includes a memory and a processor, where the memory stores a computer program that can be executed on the processor, and the processor executes the steps of the method for testing a network application according to any one of the above.
In one embodiment, a computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of testing a network application of any of the above.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method for testing a network application, the method being applied to a network application testing system, the network application testing system comprising a testing tool, a network application, an interceptor and a testing server, the method comprising:
the test tool sends a target test instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a corresponding relation between the pre-stored service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein a jar packet of a third-party server is stored in the network application, the jar packet comprises a plurality of service requests and a data structure of the return value corresponding to each service, the return value is determined according to the data structure of the return value and a preset return value setting rule, and the corresponding relation between the service request and the return value is established according to each test instruction and the corresponding target value of each test instruction;
and the testing tool determines a testing result according to the target return value and a target value corresponding to the pre-stored target testing instruction.
2. The method of claim 1, wherein the return value is a numerical value or a string.
3. The method of claim 1, wherein before the interceptor redirects the target service request to the test server, the method further comprises:
the interceptor judges whether the state of the test server is an on state, and if the state of the test server is an on state, the interceptor redirects the target service request to the test server;
and if the state of the test server is a closed state, the interceptor sends the target service request to the third party server.
4. A method according to claim 1 or 3, wherein the target service request includes a target interface and a target method, and the interceptor redirects the target service request to the test server, comprising:
the interceptor judges whether the state of the target interface is an on state, and if the state of the target interface is an on state, the interceptor redirects the target service request to the test server;
and if the interface state of the target interface is the closed state, the interceptor judges whether the state of the target method is the open state, and if the state of the target method is the open state, the interceptor redirects the target service request to the test server.
5. The method according to claim 4, wherein the method further comprises:
and if the state of the target method is the closed state, the interceptor sends the target service request to the third party server.
6. A network application testing system, which is characterized by comprising a testing tool, a network application, an interceptor and a testing server;
the test tool is used for sending a target test instruction to the network application;
the network application is used for sending a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor is used for redirecting the target service request to the test server;
the test server is configured to determine a target return value corresponding to the target service request in a pre-stored corresponding relation between the service request and the return value, and transmit the target return value to the test tool through the interceptor and the network application, where a jar packet of a third party server is stored in the network application, where the jar packet includes a plurality of service requests and a data structure of a return value corresponding to each service, where the return value is determined according to the data structure of the return value and a preset return value setting rule, and the corresponding relation between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
the test tool is further used for determining a test result according to the target return value and a target value corresponding to the target test instruction stored in advance.
7. The system of claim 6, wherein the return value is a numerical value or a string.
8. The system of claim 6, wherein the interceptor is configured to determine whether the state of the test server is an on state, and if the state of the test server is an on state, redirect the target service request to the test server;
the interceptor is further configured to send the target service request to the third party server if the state of the test server is a closed state.
9. The system according to claim 6 or 8, wherein the target service request includes a target interface and a target method, the interceptor is configured to determine whether a state of the target interface is an on state, and if the state of the target interface is an on state, redirect the target service request to the test server;
the interceptor is further configured to determine whether the state of the target method is an on state if the interface state of the target interface is an off state, and redirect the target service request to the test server if the state of the target method is an on state.
10. The system of claim 9, wherein the interceptor is configured to send the target service request to the third party server if the state of the target method is an off state.
CN201910933292.7A 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium Active CN110727588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910933292.7A CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910933292.7A CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110727588A CN110727588A (en) 2020-01-24
CN110727588B true CN110727588B (en) 2023-12-12

Family

ID=69219649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910933292.7A Active CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110727588B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100079B (en) * 2020-11-02 2022-04-12 北京淇瑀信息科技有限公司 Test method and system based on simulation data calling and electronic equipment
CN113836008B (en) * 2021-09-13 2023-10-27 支付宝(杭州)信息技术有限公司 Method and system for performing fuzzy test on virtual machine monitor
CN114978970B (en) * 2022-04-07 2023-11-24 上海钧正网络科技有限公司 Data testing system, method, equipment and medium based on custom mock platform
CN115037794B (en) * 2022-06-07 2024-06-14 抖音视界有限公司 Data acquisition method, device, computer equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110262979A (en) * 2019-06-27 2019-09-20 苏宁消费金融有限公司 A kind of simulation third party's data source test method based on MOCK platform

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496658B2 (en) * 2003-07-08 2009-02-24 Hewlett-Packard Development Company, L.P. Systems and methods for testing network services
FR2953611A1 (en) * 2009-12-07 2011-06-10 Spawnapps METHOD FOR PROVIDING A TARGET APPLICATION
US20110161825A1 (en) * 2009-12-31 2011-06-30 Tierney Chris Systems and methods for testing multiple page versions across multiple applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110262979A (en) * 2019-06-27 2019-09-20 苏宁消费金融有限公司 A kind of simulation third party's data source test method based on MOCK platform

Also Published As

Publication number Publication date
CN110727588A (en) 2020-01-24

Similar Documents

Publication Publication Date Title
CN110727588B (en) Network application testing method, system, computer equipment and readable storage medium
KR102157712B1 (en) Information leakage detection method and device
KR102104610B1 (en) Fuzzing method and device for network protocol vulnerability detection
CN113472607B (en) Application program network environment detection method, device, equipment and storage medium
CN110113440B (en) Request response method, device and terminal
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN110704312B (en) Method, device, computer equipment and storage medium for pressure test
WO2020259551A1 (en) Method and apparatus for handling network connection fault
CN111711533B (en) Fault diagnosis method, fault diagnosis device, electronic device and storage medium
US11316930B2 (en) Connection control method and device
CN111343630A (en) Network connection state detection method, computer device, and storage medium
CN107360036B (en) Network fault positioning method, terminal and server
CN111597559B (en) System command injection vulnerability detection method and device, equipment and storage medium
CN111752819B (en) Abnormality monitoring method, device, system, equipment and storage medium
US9628364B2 (en) Test automation system and method for detecting change in signature of internet application traffic protocol
CN111049945A (en) Network request optimization method, device, equipment and medium based on HTTP (hyper text transport protocol)
CN107634969B (en) Data interaction method and device
CN109547276B (en) Problem positioning method, terminal and storage medium
CN108306999B (en) Domain name resolution method and device
CN110099096B (en) Application program configuration method, device, computer equipment and storage medium
CN111343042B (en) DNS analysis test method and test system
US11176011B2 (en) Apparatus and method for transmitting fuzzing data for one-way protocol software fuzzing
CN113542045B (en) TCP port state determination method and device
CN111131528B (en) Equipment network domain determining method, server and terminal
US20230216938A1 (en) Application-based data transport apparatus and method

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