Test method and system for automatic online debugging of interface scene
By receiving and processing interface requests on the server and conducting online debugging through the web, the problem of low efficiency in the construction of composite interfaces and scenarios in the existing technology is solved, and efficient automated testing and regression are achieved.
Patent Information
- Application Number
- CN202411786581.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-25
AI Technical Summary
The existing interface automation platform is inefficient when building composite interfaces and scenarios, making it difficult to improve the efficiency of automated scenario construction and automation regression efficiency.
By receiving a single interface request initiated by the user on the server, using the onMessage method to listen to the request in real time, extracting the sessionId to determine the sender of the request, and sending the interface information to the client. Online debugging of scenario use cases through the web side to realize automated testing, and testers can view test results in real time.
It improves the productivity of interface scenario construction, simplifies the automated scenario construction process, and improves the efficiency of automation regression. Testers can quickly view test results to assist in building automated scenarios.
Smart Images

Figure CN119883887A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a testing method and system for automatic online debugging of an interface scenario. Background Art
[0002] As business needs gradually increase and business complexity gradually increases, the test regression tasks of interface testers also become more and more onerous. Therefore, an interface automation platform is often built to improve regression efficiency. However, due to the continuous increase in complex business scenarios, a large number of automated use cases need to be built, which poses a challenge to the usability and efficiency of the interface automation platform. A single interface scenario is easy to build, but composite interfaces and scenarios are more difficult to build. Therefore, how to conduct automated testing to improve the efficiency of automated scenario construction has become an urgent problem to be solved. Summary of the invention
[0003] In view of this, the present invention provides a testing method and system for automatic online debugging of an interface scenario to solve the problem of how to perform automatic testing.
[0004] In a first aspect, the present invention provides a test method for automated online debugging of an interface scenario, which is applied to a server, and the method comprises:
[0005] Receive the single interface request initiated by the user, monitor the request through onMessage, and extract the sessionId;
[0006] Determine the request sender based on sessionId and receive the interface information returned by the business server;
[0007] Send the received interface information to the corresponding client according to sessionId;
[0008] Debug the scenario use case through the web and get the test results.
[0009] The present invention receives a single interface request initiated by a user through a server, monitors the request in real time through the onMessage method to quickly respond to the request, determines which client sends the request through sessionId, so as to send the request to the business server, and then sends the interface information returned by the business server to the client, performs online debugging of scenario use cases through the web, realizes automated testing, and testers can view test results in real time to assist testers in building automated scenarios and improve the productivity of use case construction.
[0010] In an optional implementation, the test result includes the current step interface information. After debugging the scenario use case through the web terminal and obtaining the test result, the method further includes:
[0011] Parse the interface information of the current step and read the pre-configured assertion information;
[0012] Determine the interface execution status based on the assertion information. The interface execution status includes execution failure, execution success, and in progress.
[0013] According to the preset correspondence between the interface execution status and the color mark, the color mark corresponding to each interface execution status is determined.
[0014] The present invention judges the execution status of the interface according to the current step interface information and determines the color mark corresponding to each interface execution status, so that the tester can intuitively see the execution status of the interface, thereby guiding the tester to debug the scenario use case, improve the construction speed of the scenario automation use case, and improve the efficiency of automated regression.
[0015] In an optional implementation, the test result also includes response information of the current step. After debugging the scenario case through the web terminal and obtaining the test result, the method further includes:
[0016] Parse the response information of the current step to obtain the fields in the response information of the current step;
[0017] Determine whether the field in the response information of the current step is the input parameter of the next step;
[0018] If the field in the response information of the current step is the input parameter of the next step, the attribute result is extracted through jsonpath.
[0019] The present invention determines whether a field in the response information is an input parameter for the next step based on the response information of the current step, and simplifies data access through jsonpath when the field in the response information is an input parameter for the next step. The present invention is applicable to various data extraction requirements and extracts relevant attribute results to guide testers to debug scenario use cases, improve the construction speed of scenario automation use cases, and improve the efficiency of automated regression.
[0020] In an optional implementation, the test result also includes a current step configuration logic condition. After debugging the scenario case through the web terminal and obtaining the test result, the method further includes:
[0021] If the current step meets the configured logical conditions, the process flow will be based on the step results.
[0022] The present invention configures logical conditions according to the current step and determines whether the current step meets the configured logical conditions, so as to perform process flow according to the step results, reduce manual intervention, and make the steps proceed according to the automated process, so as to guide testers to debug scenario use cases, improve the construction speed of scenario automation use cases, and improve the efficiency of automated regression.
[0023] In a second aspect, the present invention provides a test method for automated online debugging of an interface scenario, which is applied to a web terminal, and the method comprises:
[0024] Respond to the single interface information entered by the user and build an interface scenario;
[0025] Listen to requests through onMessage and receive interface scenario use case debugging information returned by the server;
[0026] Debug the interface scenario use case on the web side to obtain the test results.
[0027] The present invention responds to the single interface information entered by the user through the web end, builds an interface scenario to build a friendly page design layout, listens to requests through onMessage to quickly respond to requests, receives interface scenario use case debugging information returned by the server, and performs online debugging of scenario use cases through the web end to achieve automated testing. Testers can view test results in real time to assist testers in building automated scenarios and improve the productivity of use case construction.
[0028] In a third aspect, the present invention provides a test system for automated online debugging of an interface scenario, the system comprising a web end and a server end, wherein:
[0029] The web side and the server side establish long-link communication through websocket;
[0030] The web side responds to the single interface information entered by the user and builds the interface scenario;
[0031] The user initiates a single interface request;
[0032] The web side monitors the requests sent by the server through onMessage, and the server side monitors the requests sent by the web side through onMessage and extracts the sessionId;
[0033] The server determines the request sender based on the sessionId, receives the interface information returned by the business server, and sends the received interface information to the corresponding client based on the sessionId;
[0034] Debug the scenario use case through the web and get the test results.
[0035] The present invention establishes a long link communication through websocket between the web end and the server end for communication, monitors the other party's request through the onMessage method to quickly respond to the request, and the test scenario guides the tester to debug the scenario use case through a friendly page design arrangement, and performs online debugging of the scenario use case through the web end to realize automated testing. The tester can view the test results in real time to assist the tester in building automated scenarios and improve the productivity of use case construction.
[0036] In a fourth aspect, the present invention provides a testing device for automated online debugging of an interface scenario, the device comprising:
[0037] The request monitoring module is used to receive single interface requests initiated by users, monitor the requests through onMessage, and extract the sessionId;
[0038] The first receiving module is used to determine the request sender according to the sessionId and receive the interface information returned by the business server;
[0039] The sending module is used to send the received interface information to the corresponding client according to the sessionId;
[0040] The first debugging module is used to debug the scenario use case through the web terminal to obtain the test results.
[0041] In a fifth aspect, the present invention provides a testing device for automated online debugging of an interface scenario, the device comprising:
[0042] A construction module, used to respond to the single interface information entered by the user and construct an interface scenario;
[0043] The second receiving module is used to monitor the request through onMessage and receive the interface scenario use case debugging information returned by the server;
[0044] The second debugging module is used to debug the interface scenario use case on the web side to obtain the test results.
[0045] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the test method for automated online debugging of interface scenarios of the first aspect or any corresponding embodiment thereof, or the test method for automated online debugging of interface scenarios of the second aspect.
[0046] In the seventh aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the test method for automated online debugging of interface scenarios of the above-mentioned first aspect or any corresponding embodiment, or the test method for automated online debugging of interface scenarios of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is an architectural diagram of a test system for automated online debugging of interface scenarios according to an embodiment of the present invention;
[0049] Figure 2 is an interactive schematic diagram of a test system for automated online debugging of interface scenarios according to an embodiment of the present invention;
[0050] Figure 3 It is a flowchart of a test method for automatic online debugging of an interface scenario according to an embodiment of the present invention;
[0051] Figure 4 is a flow chart of another interface scenario automated online debugging test method according to an embodiment of the present invention;
[0052] Figure 5 is a schematic diagram of a web platform interface according to an embodiment of the present invention;
[0053] Figure 6 is a structural block diagram of a test device for automatic online debugging of interface scenarios according to an embodiment of the present invention;
[0054] Figure 7 is a structural block diagram of a test device for automated online debugging of another interface scenario according to an embodiment of the present invention;
[0055] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0057] The current scene automation writing efficiency is low, and the test result feedback effect is not friendly, especially in the face of complex large-scale business scenarios, the construction cost is high, and the input-output ratio is not high, resulting in delayed automation construction. Moreover, the scene construction needs to be arranged once, and when requested in the form of HHTTP, it needs to be executed in one direction and cannot be interrupted in the middle. Especially when there are many steps in the scene, an error in a certain step will cause repeated debugging many times to complete. This execution process belongs to black box testing and process intervention is impossible. Based on the above problems, in order to improve the efficiency of automated scene construction, an embodiment of the present invention provides a test method for automated online debugging of interface scenarios and a test system for automated online debugging of interface scenarios to assist testers in automated scene construction and improve the productivity of use case construction.
[0058] First, let's briefly summarize the concepts in this embodiment: automated testing is testing for server interfaces, scenario testing is a set of tests for a single interface, and scenario orchestration, i.e., interface combination orchestration, is referred to as scenario steps. In actual business, scenario testing is indispensable, and scenario testing has its own particularity, involving parameter dependencies, logical dependencies, and other relationships between scenario steps.
[0059] like Figure 1 As shown, Figure 1 The architecture diagram shows that the architecture includes an access layer, an application layer, and a data storage layer. The access layer is a web terminal, and users access it through the web terminal. The application layer is used for business applications, including automation services and plug-in services. The automation service provides automation functions, and the plug-in service provides plug-in functions. The data storage layer is used for data storage, and MongoDB is used as the data storage.
[0060] The complete process of a complete scene arrangement includes the following steps:
[0061] Step 1: Prepare the scenario: The user enters single interface information in the web platform (this embodiment takes HTTP request as an example, and the comparison attributes include request parameters, request header, request body, request type, request method, assertion information, logical conditions, etc.), which can be HTTP, Dubbo, or other custom plug-ins (such as encapsulated login, calculation function, etc.);
[0062] Step 2: Prepare the scenario: Users combine the above scenario steps on the web platform according to the needs of the business scenario;
[0063] Step 3: Scenario testing: Users verify the results of the scenario on the web platform. The scenario information is presented in a table on the platform and is executed in a top-down order. The web page provides start, pause, continue, and move up and down. The executed steps are highlighted and the results are prompted.
[0064] The embodiment of the present invention provides a test system for automatic online debugging of interface scenarios, such as Figure 2 As shown, the system includes a web end and a server end.
[0065] Specifically, the web end and the server end first establish a long link communication through websocket technology, and both parties listen to the requests sent by the other party through onMessage at the same time. Both parties confirm their identities through the session's unique information sessionId, and this information is carried during the front-end and back-end data transmission process. During the test process of interface scenario automated online debugging, the web end and the server end will define the operation type enumeration value to control the flow of the scenario test, such as start, pause, continue, end, etc.
[0066] The user initiates a single interface request. The web end and the server end simultaneously monitor the requests sent by the other party through onMessage and extract the sessionId. The server end determines the sender of the request based on the sessionId, receives the interface information returned by the business server end, and sends the received interface information to the corresponding client end based on the sessionId. The scenario use case is debugged through the web end to obtain the test results.
[0067] The test system for automated online debugging of interface scenarios provided in this embodiment establishes long-link communication through websocket between the web end and the server end for communication, monitors the other party's request through the onMessage method to quickly respond to the request, and the test scenario guides the tester to debug the scenario use case through a friendly page design arrangement, and performs online debugging of the scenario use case through the web end to realize automated testing. The tester can view the test results in real time to assist the tester in building automated scenarios and improve the productivity of use case construction.
[0068] An embodiment of the present invention also provides an embodiment of a test method for automated online debugging of an interface scenario. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0069] In this embodiment, a test method for automatic online debugging of an interface scenario is provided, which is applied to a server. Figure 3 is a flow chart of a test method for automatic online debugging of an interface scenario according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0070] Step S301, receiving a single interface request initiated by a user, and monitoring the request through onMessage to extract the sessionId.
[0071] In an embodiment of the present invention, the user starts a step in the scenario, that is, initiates a single interface request, which is transmitted to the server through the send method. The server receives the single interface request initiated by the user, monitors the request through the onMessage monitoring mechanism, and extracts the sessionId for identity confirmation.
[0072] Step S302, determine the request sender according to the sessionId, and receive the interface information returned by the business server.
[0073] In an embodiment of the present invention, the server uses sessionId to determine which client sends the request, that is, to confirm the request sender. The server forwards the request to the business server. After the business server receives the request forwarded by the server, it uses sessionId to associate the user conversation and executes related business operations. The server receives the interface information returned by the business server.
[0074] Step S303: Send the received interface information to the corresponding client according to the sessionId.
[0075] In the embodiment of the present invention, the server searches for the corresponding client according to the sessionId through the send method, so as to send the received interface information to the corresponding client according to the sessionId.
[0076] Step S304, debug the scenario use case through the web terminal to obtain the test result.
[0077] In an embodiment of the present invention, a user performs a verification test on the result of the scenario on the web side. The web page provides functions such as start, pause, continue, move up and down, highlights the executed steps, and prompts the test results to obtain the test results.
[0078] The server receives single interface requests initiated by users, monitors requests in real time through the onMessage method, responds to requests quickly, determines which client sends the request through sessionId, and sends the request to the business server, and then sends the interface information returned by the business server to the client. The scenario use case is debugged online through the web to achieve automated testing. Testers can view test results instantly to assist testers in building automated scenarios and improve the productivity of use case construction.
[0079] In some optional implementations, the test result in the above step S304 includes the current step interface information, the current step response information and the current step configuration logic condition.
[0080] Specifically, after debugging the scenario use case through the web terminal and obtaining the test result, when the test result is the current step interface information, the method further includes:
[0081] Step S305, parse the interface information of the current step and read the pre-configured assertion information.
[0082] Step S306, judging the interface execution status according to the assertion information, the interface execution status including execution failure, execution success and in progress.
[0083] Step S307: determining the color mark corresponding to each interface execution state according to the preset correspondence between the interface execution state and the color mark.
[0084] In an embodiment of the present invention, the current step interface information includes information such as HTTP status, response content, and header information. The current step interface information is parsed, and the assertion information therein is often a predefined rule, which is used to determine the execution status of the interface. If the status code of the interface response matches the preset success status code, the interface execution status is determined to be successful. If the status code of the interface response indicates an error, the interface execution status is determined to be failed. If the final response is not received, the interface execution status is determined to be in progress.
[0085] The correspondence between the interface execution status and the color mark is preset, green represents successful execution, red represents failed execution, and blue represents execution in progress. This is only an example and is not intended to be limiting. According to the preset correspondence between the interface execution status and the color mark, the color mark corresponding to each interface execution status is determined, and the color mark is presented on the web page.
[0086] By judging the execution status of the interface according to the interface information of the current step and determining the color mark corresponding to the execution status of each interface, it is convenient for testers to intuitively see the execution status of the interface, so as to guide testers to debug scenario use cases, improve the construction speed of scenario automation use cases, and improve the efficiency of automated regression.
[0087] Specifically, after debugging the scenario use case through the web end and obtaining the test result, when the test result is the response information of the current step, the method further includes:
[0088] Step S308, parse the response information of the current step to obtain the fields in the response information of the current step.
[0089] Step S309, determine whether the field in the response information of the current step is an input parameter for the next step.
[0090] Step S310: If the field in the response information of the current step is the input parameter of the next step, the attribute result is extracted through jsonpath.
[0091] In an embodiment of the present invention, after obtaining the interface response information of the current step, the response information of the current step is parsed to extract fields. The response information generally includes field names, extraction paths (such as jsonpath, etc.), step identifiers and other information. According to pre-set rules, it is determined which fields need to be passed, that is, it is determined whether the fields in the response information of the current step are input parameters for the next step. If the fields in the corresponding information of the current step are input parameters for the next step, the relevant attribute results are extracted through jsonpath. The attribute results may include data items pointed to by jsonpath, arrays matched by jsonpath, jsonpath objects, etc. This is only for example and not as a limitation.
[0092] By judging whether the fields in the response information are the input parameters of the next step based on the response information of the current step, and simplifying data access through jsonpath when the fields in the response information are the input parameters of the next step, it is suitable for a variety of data extraction needs and extracts relevant attribute results to guide testers to debug scenario use cases, improve the construction speed of scenario automation use cases, and improve the efficiency of automated regression.
[0093] Specifically, after debugging the scenario case through the web end and obtaining the test result, when the test result is a logical condition for configuring the current step, the method further includes:
[0094] Step S311, if the current step meets the configuration logic conditions, the process flow is performed according to the step result.
[0095] In an embodiment of the present invention, what kind of test results or status are set in advance for process flow. It can be set that the process flow is performed when a certain field value or response status meets specific conditions. The logical conditions are set, and the process jumps when the conditions are met, that is, the step jumps, so as to improve the flexibility of the automated process.
[0096] The test method for automated online debugging of interface scenarios provided in this embodiment configures logical conditions according to the current step, determines whether the current step meets the configured logical conditions, and performs process flow according to the step results, thereby reducing manual intervention and allowing the steps to be performed according to the automated process, thereby guiding testers to debug scenario use cases, improving the speed of building scenario automation use cases, and improving the efficiency of automated regression.
[0097] In this embodiment, a test method for automatic online debugging of an interface scenario is provided, which is applied to a web terminal. Figure 4 is a flow chart of a test method for automatic online debugging of an interface scenario according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0098] Step S401, responding to the single interface information entered by the user and constructing an interface scenario.
[0099] Step S402, monitor the request through onMessage, and receive the interface scenario use case debugging information returned by the server.
[0100] Step S403, debugging the interface scenario use case on the web side to obtain the test result.
[0101] In an embodiment of the present invention, the user enters single interface information on the web side, and the user combines the scenario steps on the web side according to the needs of the business scenario to construct an interface scenario. The web side and the client define operation type enumeration values to control the process of scenario testing, such as start, pause, continue, end, etc.
[0102] The web side listens to the request through onMessage and receives the interface scenario use case debugging information returned by the server. The user verifies the results of the scenario on the web side, such as Figure 5 As shown, the scene information is presented on the web side, and the web side page provides functions such as start, pause, continue, and move up and down.
[0103] The test method for automated online debugging of interface scenarios provided in this embodiment responds to single interface information entered by users through the web side, builds interface scenarios to build friendly page design layout, listens to requests through onMessage to quickly respond to requests, receives interface scenario use case debugging information returned by the server side, and performs online debugging of scenario use cases through the web side to implement automated testing. Testers can view test results in real time to assist testers in building automated scenarios and improve the productivity of use case construction.
[0104] As a specific application example of the embodiment of the present invention, taking http request as an example, the specific execution process is as follows:
[0105] 1. The web end and the server end first establish a long link communication through the websocket technology. Both parties monitor each other's sending requests (onMessage method) at the same time. Both parties confirm their identities through the session's unique information (sessionId). This information is carried in the front-end and back-end data transmission;
[0106] 2. The web side and the server side will define the operation type enumeration value to control the process of scenario testing, such as start, pause, continue, end, etc.
[0107] 3. The user starts a step in the scenario, that is, initiates a single interface request and passes it to the server through the send method;
[0108] 4. The server receives the request, monitors the request through the onMessage method, and uses the sessionId to distinguish which client sends the request. The server forwards the request to the business server, obtains the interface returned by the business server, and uses the send method to send the corresponding client result according to the sessionId;
[0109] 5. The web side monitors the request through the onMessage method and obtains the result from the server;
[0110] a. Determine whether the result is successful based on the assertion information configured in the current step interface information, and present it in color on the web page (red for failure, green for success, and blue for in progress);
[0111] b. If the field in the response information of the current step is the input parameter of the next step, extract the relevant attribute results through jsonpath;
[0112] c. If the current step is configured with a logical condition, the process flow will be transferred according to the step result, that is, the step will be jumped;
[0113] 6. Complete scenario testing means executing all steps in the scenario sequentially. Each step will follow the above process 1-5 in turn. In the middle, debugging can be performed by pausing and continuing to achieve flexible testing.
[0114] The test method for automated online debugging of interface scenarios provided in this embodiment guides testers to debug scenario use cases through friendly page design arrangements of the entire test scenario. The execution method is flexible and varied, and the execution process is simple and clear, which greatly improves the construction speed of scenario automation use cases and improves the efficiency of automated regression.
[0115] In this embodiment, a test device for automatic online debugging of an interface scenario is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0116] This embodiment provides a test device for automatic online debugging of an interface scenario, which is applied to a server, such as Figure 6 As shown, including:
[0117] The request monitoring module 601 is used to receive a single interface request initiated by a user, monitor the request through onMessage, and extract the sessionId.
[0118] The first receiving module 602 is used to determine the request sender according to the sessionId and receive the interface information returned by the business server.
[0119] The sending module 603 is used to send the received interface information to the corresponding client according to the sessionId.
[0120] The first debugging module 604 is used to debug the scenario use case through the web terminal to obtain the test results.
[0121] In some optional embodiments, the device further comprises:
[0122] The reading module is used to parse the interface information of the current step and read the pre-configured assertion information.
[0123] The first judgment module is used to judge the interface execution status according to the assertion information, and the interface execution status includes execution failure, execution success and in progress.
[0124] The marking module is used to determine the color mark corresponding to each interface execution state according to the preset corresponding relationship between the interface execution state and the color mark.
[0125] In some optional embodiments, the device further comprises:
[0126] The parsing module is used to parse the response information of the current step to obtain the fields in the response information of the current step.
[0127] The second judgment module is used to judge whether the field in the response information of the current step is an input parameter of the next step.
[0128] The extraction module is used to extract the attribute results through jsonpath if the field in the response information of the current step is the input parameter of the next step.
[0129] In some optional embodiments, the device further comprises:
[0130] The process jump module is used to transfer the process according to the step result if the current step meets the configured logical conditions.
[0131] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0132] This embodiment also provides another test device for automatic online debugging of interface scenarios, which is applied to the web side, such as Figure 7 As shown, including:
[0133] The construction module 701 is used to respond to the single interface information entered by the user and construct an interface scenario.
[0134] The second receiving module 702 is used to monitor the request through onMessage and receive the interface scenario use case debugging information returned by the server.
[0135] The second debugging module 703 is used to debug the interface scenario use case on the web side to obtain the test results.
[0136] The test device for automated online debugging of interface scenarios in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0137] The embodiment of the present invention also provides a computer device having the above Figure 6 The interface scenario shown is a test device for automated online debugging or Figure 7 The interface scenario shown is a test setup for automated online debugging.
[0138] See also Figure 8 , Figure 8is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0139] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0140] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0141] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0142] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0143] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0144] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, etc. The output device 40 can include a display device, etc.
[0145] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0146] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0147] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope of the present application.
Claims
1. A test method for automated online debugging of an interface scenario, characterized in that: Applied to the server, the method includes: Receive the single interface request initiated by the user, monitor the request through onMessage, and extract the sessionId; Determine the request sender according to the sessionId, and receive the interface information returned by the business server; Sending the received interface information to the corresponding client according to the sessionId; Debug the scenario use case through the web and get the test results.
2. The method according to claim 1, characterized in that The test result includes the interface information of the current step. After debugging the scenario case through the web terminal and obtaining the test result, the method further includes: Parsing the interface information of the current step and reading the pre-configured assertion information; Determine the interface execution status according to the assertion information, the interface execution status including execution failure, execution success and in progress; According to the preset correspondence between the interface execution status and the color mark, the color mark corresponding to each interface execution status is determined.
3. The method according to claim 1, characterized in that The test result also includes response information of the current step. After debugging the scenario case through the web terminal and obtaining the test result, the method further includes: Parsing the response information of the current step to obtain the fields in the response information of the current step; Determine whether the field in the response information of the current step is an input parameter for the next step; If the field in the response information of the current step is the input parameter of the next step, the attribute result is extracted through jsonpath.
4. The method according to claim 1, characterized in that: The test result also includes the current step configuration logic condition. After debugging the scenario use case through the web terminal and obtaining the test result, the method further includes: If the current step meets the configuration logic conditions, the process flow is performed according to the step result.
5. A test method for automated online debugging of interface scenarios, characterized in that: Applied to the web side, the method includes: Respond to the single interface information entered by the user and build an interface scenario; Listen to requests through onMessage and receive interface scenario use case debugging information returned by the server; Debug the interface scenario use case on the web side to obtain the test results.
6. A test system for automated online debugging of interface scenarios, characterized in that: The system includes a web end and a server end, wherein: The web end and the server end establish long link communication through websocket; The web terminal responds to the single interface information entered by the user and constructs an interface scenario; The user initiates a single interface request; The web end monitors the request sent by the server end through onMessage, and the server end monitors the request sent by the web end through onMessage and extracts sessionId; The server determines the request sender according to the sessionId, receives the interface information returned by the business server, and sends the received interface information to the corresponding client according to the sessionId; Debug the scenario use case through the web and get the test results.
7. A test device for automated online debugging of interface scenarios, characterized in that: Applied to the server, the device comprises: The request monitoring module is used to receive single interface requests initiated by users, monitor the requests through onMessage, and extract the sessionId; A first receiving module, used to determine the request sender according to the sessionId, and receive the interface information returned by the business server; A sending module, used to send the received interface information to the corresponding client according to the sessionId; The first debugging module is used to debug the scenario use case through the web terminal to obtain the test results.
8. A test device for automated online debugging of interface scenarios, characterized in that: Applied to a web terminal, the device includes: A construction module, used to respond to the single interface information entered by the user and construct an interface scenario; The second receiving module is used to monitor the request through onMessage and receive the interface scenario use case debugging information returned by the server; The second debugging module is used to debug the interface scenario use case on the web side to obtain the test results.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the test method for automated online debugging of interface scenarios described in any one of claims 1 to 4, or the test method for automated online debugging of interface scenarios described in claim 5.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the test method for automatic online debugging of an interface scenario described in any one of claims 1 to 4, or the test method for automatic online debugging of an interface scenario described in claim 5.